blob: 4612eb1784d377e80c8bd3776900f91e437b95db [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
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 Williams2bfbbd62016-06-13 10:18:19 -070017---
Zack Williamsa2763112017-01-03 11:38:38 -070018# collect-diag-playbook.yml
Zack Williams2bfbbd62016-06-13 10:18:19 -070019# Collects diagnostic information for the currently running cord-pod config
20
Zack Williamsba7af9e2016-06-27 17:21:09 -070021- name: Create diag_dir fact
Zack Williams04106732016-06-27 20:55:32 -070022 hosts: head
23 tasks:
Zack Williams35624562016-08-28 17:12:26 -070024 - name: Set diag_dir name to diag-rfc3339_datetime
25 set_fact:
Zack Williams04106732016-06-27 20:55:32 -070026 diag_dir: "diag-{{ ansible_date_time.iso8601_basic_short }}"
Zack Williamsba7af9e2016-06-27 17:21:09 -070027
Zack Williams2bfbbd62016-06-13 10:18:19 -070028- name: Diagnostics on head node
29 hosts: head
30 roles:
31 - head-diag
Zack Williamsba7af9e2016-06-27 17:21:09 -070032
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 Williams04106732016-06-27 20:55:32 -070040 tasks:
Zack Williams35624562016-08-28 17:12:26 -070041 - name: rsync diag_dir from compute nodes
42 synchronize:
Zack Williams04106732016-06-27 20:55:32 -070043 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 Williamsba7af9e2016-06-27 17:21:09 -070048