more diag info gathering, install 'curl' in bootstrap script to support ONOS REST API checks
diff --git a/roles/head-diag/files/docker_logs.sh b/roles/head-diag/files/docker_logs.sh
new file mode 100644
index 0000000..ba22d6a
--- /dev/null
+++ b/roles/head-diag/files/docker_logs.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+mkdir -p ~/docker_logs
+rm -rf ~/docker_logs/*
+
+for container in `docker ps --format "{{.Names}}"`;
+do
+ docker logs $container > ~/docker_logs/$container.log 2>&1;
+done
diff --git a/roles/head-diag/tasks/main.yml b/roles/head-diag/tasks/main.yml
index d9df5f4..ed9346f 100644
--- a/roles/head-diag/tasks/main.yml
+++ b/roles/head-diag/tasks/main.yml
@@ -38,13 +38,28 @@
- "nova list --all-tenants"
- "keystone tenant-list"
-- name: ONOS diag collection
+- name: ONOS diag collection - REST API
shell: "curl -X GET -u karaf:karaf http://onos-cord-1:8181/onos/v1/{{ item }} | python -m json.tool > {{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
with_items:
- "hosts"
+- name: ONOS diag collection - ONOS CLI
+ shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > {{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
+ with_items:
+ - "cordvtn-nodes"
+ - "cordvtn-node-check nova-compute-1"
+
- name: XOS diag collection
- shell: "ssh ubuntu@xos \"{{ item }}\" > {{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
+ shell: "ssh ubuntu@xos-1 \"{{ item }}\" > {{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
with_items:
- "docker ps"
+- name: Copy and run XOS docker logs script
+ command: "{{ item }}"
+ with_items:
+ - "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh"
+ - "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'"
+
+- name: XOS docker logs retrieval
+ command: "rsync -avP ubuntu@xos-1:~/docker_logs/ {{ diag_dir }}/xos/"
+
diff --git a/scripts/single-node-pod.sh b/scripts/single-node-pod.sh
index babb2f4..fe1c123 100755
--- a/scripts/single-node-pod.sh
+++ b/scripts/single-node-pod.sh
@@ -27,7 +27,7 @@
function bootstrap() {
cd ~
sudo apt-get update
- sudo apt-get -y install software-properties-common git mosh tmux dnsutils python-netaddr
+ sudo apt-get -y install software-properties-common curl git mosh tmux dnsutils python-netaddr
sudo add-apt-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible