split out head/compute diag roles, collect diag on head node
diff --git a/cord-diag-playbook.yml b/cord-diag-playbook.yml
index 2adf726..3e7a157 100644
--- a/cord-diag-playbook.yml
+++ b/cord-diag-playbook.yml
@@ -1,7 +1,24 @@
---
# Collects diagnostic information for the currently running cord-pod config
+- name: Create diag_dir fact
+ set_fact: diag_dir="~/diag-{{ ansible_date_time.iso8601_basic_short }}"
+
- name: Diagnostics on head node
hosts: head
roles:
- head-diag
+
+- name: Diagnostics on compute nodes
+ hosts: compute
+ roles:
+ - compute-diag
+
+- name: Collect compute node diagnostics on head node
+ hosts: compute
+ synchronize:
+ src: "{{ diag_dir }}"
+ dest: "{{ diag_dir }}"
+ recursive: yes
+ delegate_to: "{{ groups['head'][0] }}"
+
diff --git a/inventory/single-localhost b/inventory/single-localhost
index 36fdcaa..5b70063 100644
--- a/inventory/single-localhost
+++ b/inventory/single-localhost
@@ -7,3 +7,6 @@
[cloudlab]
localhost
+[compute]
+nova-compute-1
+
diff --git a/roles/compute-diag/tasks/main.yml b/roles/compute-diag/tasks/main.yml
new file mode 100644
index 0000000..050c7c5
--- /dev/null
+++ b/roles/compute-diag/tasks/main.yml
@@ -0,0 +1,16 @@
+---
+# compute-diag/tasks/main.yml
+
+- name: Create diag_dir subdirs
+ file:
+ dest="{{ diag_dir }}/{{ inventory_hostname }}"
+
+- name: Compute node diag collection
+ shell: "{{ item }} > {{ diag_dir }}/{{ inventory_hostname}}/{{ item | regex_replace('[^\\w-]', '_')}}"
+ with_items:
+ - "arp -n"
+ - "brctl show"
+ - "cat /etc/resolv.conf"
+ - "ifconfig -a"
+ - "route -n"
+
diff --git a/roles/head-diag/tasks/main.yml b/roles/head-diag/tasks/main.yml
index 09e51a4..71723a2 100644
--- a/roles/head-diag/tasks/main.yml
+++ b/roles/head-diag/tasks/main.yml
@@ -1,9 +1,6 @@
---
# head-diag/tasks/main.yml
-- name: Create diag_dir fact
- set_fact: diag_dir="~/diag-{{ ansible_date_time.iso8601_basic_short }}"
-
- name: Create diag_dir subdirs
file:
dest="{{ diag_dir }}/{{ item }}"
@@ -14,7 +11,6 @@
- openstack
- onos
- xos
- - nova-compute
- name: Networking diag collection
shell: "{{ item }} > {{ diag_dir }}/net/{{ item | regex_replace('[^\\w-]', '_')}}"
@@ -57,6 +53,7 @@
- "cordvtn-nodes"
- "cordvtn-node-check nova-compute-1"
- "hosts"
+ - "dhcp-list"
- name: XOS diag collection
shell: "ssh ubuntu@xos-1 \"{{ item }}\" > {{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
@@ -65,21 +62,10 @@
- "arp -n"
- "ifconfig -a"
-- name: Copy and run XOS docker logs script
+- name: Copy/run/retrieve XOS docker logs
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/"
-
-- name: nova-compute diag collection
- shell: "ssh ubuntu@nova-compute-1 \"{{ item }}\" > {{ diag_dir }}/nova-compute/{{ item | regex_replace('[^\\w-]', '_')}}"
- with_items:
- - "arp -n"
- - "brctl show"
- - "ifconfig -a"
- - "ping -c 3 172.27.0.2"
- - "route -n"
+ - "rsync -avP ubuntu@xos-1:~/docker_logs/ {{ diag_dir }}/xos/"