blob: 0dc33624df5e63a7fc13e91b2083fa7d0d0d7b88 [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
Zack Williamscb52e5b2016-06-13 11:25:29 -070017 - nova-compute
Zack Williams2bfbbd62016-06-13 10:18:19 -070018
19- name: Networking diag collection
20 shell: "{{ item }} > {{ diag_dir }}/net/{{ item | regex_replace('[^\\w-]', '_')}}"
21 with_items:
22 - "ifconfig -a"
23 - "route -n"
Zack Williamscb52e5b2016-06-13 11:25:29 -070024 - "arp -n"
Zack Williams2bfbbd62016-06-13 10:18:19 -070025 - "brctl show"
26 - "cat /etc/resolv.conf"
Zack Williamscb52e5b2016-06-13 11:25:29 -070027 - "sudo uvt-kvm list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070028
29- name: Juju diag collection
30 shell: "{{ item }} > {{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
31 with_items:
32 - "juju status --format=summary"
33 - "juju status --format=json"
34
35- name: OpenStack diag collection
36 shell: "source ~/admin-openrc.sh && {{ item }} > {{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
37 args:
38 executable: "/bin/bash"
39 with_items:
40 - "nova image-list"
41 - "nova list --all-tenants"
42 - "keystone tenant-list"
43
Zack Williams4e5d1d22016-06-13 11:10:03 -070044- name: ONOS diag collection - REST API
Zack Williamscb52e5b2016-06-13 11:25:29 -070045 shell: "curl -X GET -u karaf:karaf http://onos-cord-1:8181/onos/v1/{{ item }} | python -m json.tool > {{ diag_dir }}/onos/rest_{{ item | regex_replace('[^\\w-]', '_') }}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070046 with_items:
47 - "hosts"
48
Zack Williams4e5d1d22016-06-13 11:10:03 -070049- name: ONOS diag collection - ONOS CLI
50 shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > {{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
51 with_items:
52 - "cordvtn-nodes"
53 - "cordvtn-node-check nova-compute-1"
Zack Williamscb52e5b2016-06-13 11:25:29 -070054 - "hosts"
Zack Williams4e5d1d22016-06-13 11:10:03 -070055
Zack Williams2bfbbd62016-06-13 10:18:19 -070056- name: XOS diag collection
Zack Williams4e5d1d22016-06-13 11:10:03 -070057 shell: "ssh ubuntu@xos-1 \"{{ item }}\" > {{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070058 with_items:
59 - "docker ps"
Zack Williamscb52e5b2016-06-13 11:25:29 -070060 - "arp -n"
61 - "ifconfig -a"
Zack Williams2bfbbd62016-06-13 10:18:19 -070062
Zack Williams4e5d1d22016-06-13 11:10:03 -070063- name: Copy and run XOS docker logs script
64 command: "{{ item }}"
65 with_items:
66 - "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh"
67 - "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'"
68
69- name: XOS docker logs retrieval
70 command: "rsync -avP ubuntu@xos-1:~/docker_logs/ {{ diag_dir }}/xos/"
71
Zack Williamscb52e5b2016-06-13 11:25:29 -070072
73- name: nova-compute diag collection
74 shell: "ssh ubuntu@nova-compute-1 \"{{ item }}\" > {{ diag_dir }}/nova-compute/{{ item | regex_replace('[^\\w-]', '_')}}"
75 with_items:
76 - "arp -n"
77 - "brctl show"
78 - "ifconfig -a"
79 - "ping -c 3 172.27.0.2"
80 - "route -n"
81