blob: d9df5f4bbad6d4e9397b33cc9366a6b3706fd8e8 [file] [log] [blame]
Zack Williams2bfbbd62016-06-13 10:18:19 -07001---
2# head-diag/tasks/main.yml
3
4- name: Create diag_dir fact
5 set_fact: diag_dir="~/diag-{{ ansible_date_time.iso8601_basic_short }}"
6
7- name: Create diag_dir subdirs
8 file:
9 dest="{{ diag_dir }}/{{ item }}"
10 state=directory
11 with_items:
12 - net
13 - juju
14 - openstack
15 - onos
16 - xos
17
18- name: Networking diag collection
19 shell: "{{ item }} > {{ diag_dir }}/net/{{ item | regex_replace('[^\\w-]', '_')}}"
20 with_items:
21 - "ifconfig -a"
22 - "route -n"
23 - "brctl show"
24 - "cat /etc/resolv.conf"
25
26- name: Juju diag collection
27 shell: "{{ item }} > {{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
28 with_items:
29 - "juju status --format=summary"
30 - "juju status --format=json"
31
32- name: OpenStack diag collection
33 shell: "source ~/admin-openrc.sh && {{ item }} > {{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
34 args:
35 executable: "/bin/bash"
36 with_items:
37 - "nova image-list"
38 - "nova list --all-tenants"
39 - "keystone tenant-list"
40
41- name: ONOS diag collection
42 shell: "curl -X GET -u karaf:karaf http://onos-cord-1:8181/onos/v1/{{ item }} | python -m json.tool > {{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
43 with_items:
44 - "hosts"
45
46- name: XOS diag collection
47 shell: "ssh ubuntu@xos \"{{ item }}\" > {{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
48 with_items:
49 - "docker ps"
50