Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 1 | --- |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 2 | # collect-diag-playbook.yml |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 3 | # Collects diagnostic information for the currently running cord-pod config |
| 4 | |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 5 | - name: Create diag_dir fact |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 6 | hosts: head |
| 7 | tasks: |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 8 | - name: Set diag_dir name to diag-rfc3339_datetime |
| 9 | set_fact: |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 10 | diag_dir: "diag-{{ ansible_date_time.iso8601_basic_short }}" |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 11 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 12 | - name: Diagnostics on head node |
| 13 | hosts: head |
| 14 | roles: |
| 15 | - head-diag |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 16 | |
| 17 | - name: Diagnostics on compute nodes |
| 18 | hosts: compute |
| 19 | roles: |
| 20 | - compute-diag |
| 21 | |
| 22 | - name: Collect compute node diagnostics on head node |
| 23 | hosts: compute |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 24 | tasks: |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 25 | - name: rsync diag_dir from compute nodes |
| 26 | synchronize: |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 27 | src: "/tmp/{{ hostvars[groups['head'][0]]['diag_dir'] }}/{{ inventory_hostname }}" |
| 28 | dest: "~/{{ hostvars[groups['head'][0]]['diag_dir'] }}/" |
| 29 | recursive: yes |
| 30 | mode: pull |
| 31 | delegate_to: "{{ groups['head'][0] }}" |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 32 | |