blob: fb477e53aadbc18bc6bb96257936b2c70a363654 [file] [log] [blame]
Zack Williams2bfbbd62016-06-13 10:18:19 -07001---
Zack Williamsa2763112017-01-03 11:38:38 -07002# collect-diag-playbook.yml
Zack Williams2bfbbd62016-06-13 10:18:19 -07003# Collects diagnostic information for the currently running cord-pod config
4
Zack Williamsba7af9e2016-06-27 17:21:09 -07005- name: Create diag_dir fact
Zack Williams04106732016-06-27 20:55:32 -07006 hosts: head
7 tasks:
Zack Williams35624562016-08-28 17:12:26 -07008 - name: Set diag_dir name to diag-rfc3339_datetime
9 set_fact:
Zack Williams04106732016-06-27 20:55:32 -070010 diag_dir: "diag-{{ ansible_date_time.iso8601_basic_short }}"
Zack Williamsba7af9e2016-06-27 17:21:09 -070011
Zack Williams2bfbbd62016-06-13 10:18:19 -070012- name: Diagnostics on head node
13 hosts: head
14 roles:
15 - head-diag
Zack Williamsba7af9e2016-06-27 17:21:09 -070016
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 Williams04106732016-06-27 20:55:32 -070024 tasks:
Zack Williams35624562016-08-28 17:12:26 -070025 - name: rsync diag_dir from compute nodes
26 synchronize:
Zack Williams04106732016-06-27 20:55:32 -070027 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 Williamsba7af9e2016-06-27 17:21:09 -070032