Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 17 | --- |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 18 | # collect-diag-playbook.yml |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 19 | # Collects diagnostic information for the currently running cord-pod config |
| 20 | |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 21 | - name: Create diag_dir fact |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 22 | hosts: head |
| 23 | tasks: |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 24 | - name: Set diag_dir name to diag-rfc3339_datetime |
| 25 | set_fact: |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 26 | diag_dir: "diag-{{ ansible_date_time.iso8601_basic_short }}" |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 27 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 28 | - name: Diagnostics on head node |
| 29 | hosts: head |
| 30 | roles: |
| 31 | - head-diag |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 32 | |
| 33 | - name: Diagnostics on compute nodes |
| 34 | hosts: compute |
| 35 | roles: |
| 36 | - compute-diag |
| 37 | |
| 38 | - name: Collect compute node diagnostics on head node |
| 39 | hosts: compute |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 40 | tasks: |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 41 | - name: rsync diag_dir from compute nodes |
| 42 | synchronize: |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 43 | src: "/tmp/{{ hostvars[groups['head'][0]]['diag_dir'] }}/{{ inventory_hostname }}" |
| 44 | dest: "~/{{ hostvars[groups['head'][0]]['diag_dir'] }}/" |
| 45 | recursive: yes |
| 46 | mode: pull |
| 47 | delegate_to: "{{ groups['head'][0] }}" |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 48 | |