blob: 1b40a2d21ac8a10daea4af897eb74848570b042d [file] [log] [blame]
Zack Williams2bfbbd62016-06-13 10:18:19 -07001---
2# head-diag/tasks/main.yml
3
Zack Williams2bfbbd62016-06-13 10:18:19 -07004- name: Create diag_dir subdirs
5 file:
Zack Williams04106732016-06-27 20:55:32 -07006 dest="~/{{ diag_dir }}/{{ item }}"
Zack Williams2bfbbd62016-06-13 10:18:19 -07007 state=directory
8 with_items:
9 - net
10 - juju
11 - openstack
12 - onos
13 - xos
14
15- name: Networking diag collection
Zack Williams04106732016-06-27 20:55:32 -070016 shell: "{{ item }} > ~/{{ diag_dir }}/net/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070017 with_items:
18 - "ifconfig -a"
19 - "route -n"
Zack Williamscb52e5b2016-06-13 11:25:29 -070020 - "arp -n"
Zack Williams2bfbbd62016-06-13 10:18:19 -070021 - "brctl show"
22 - "cat /etc/resolv.conf"
Zack Williamscb52e5b2016-06-13 11:25:29 -070023 - "sudo uvt-kvm list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070024
25- name: Juju diag collection
Zack Williams04106732016-06-27 20:55:32 -070026 shell: "{{ item }} > ~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070027 with_items:
28 - "juju status --format=summary"
29 - "juju status --format=json"
30
31- name: OpenStack diag collection
Zack Williams04106732016-06-27 20:55:32 -070032 shell: "source ~/admin-openrc.sh && {{ item }} > ~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070033 args:
34 executable: "/bin/bash"
35 with_items:
Zack Williamsa6536462016-06-13 13:13:33 -070036 - "glance image-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070037 - "nova list --all-tenants"
Zack Williams85fd3042016-06-13 13:47:58 -070038 - "nova host-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070039 - "keystone tenant-list"
Zack Williamsa6536462016-06-13 13:13:33 -070040 - "keystone user-list"
41 - "neutron net-list"
42 - "neutron subnet-list"
Zack Williams85fd3042016-06-13 13:47:58 -070043 - "neutron port-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070044
Zack Williams4e5d1d22016-06-13 11:10:03 -070045- name: ONOS diag collection - REST API
Zack Williams04106732016-06-27 20:55:32 -070046 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 -070047 with_items:
48 - "hosts"
49
Zack Williams4e5d1d22016-06-13 11:10:03 -070050- name: ONOS diag collection - ONOS CLI
Zack Williams04106732016-06-27 20:55:32 -070051 shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > ~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
Zack Williams4e5d1d22016-06-13 11:10:03 -070052 with_items:
Zack Williamsae17c502016-06-28 22:05:19 -070053 - "apps -s -a"
54 - "bundle:list"
Zack Williams4e5d1d22016-06-13 11:10:03 -070055 - "cordvtn-node-check nova-compute-1"
Zack Williamsae17c502016-06-28 22:05:19 -070056 - "cordvtn-nodes"
Zack Williamsba7af9e2016-06-27 17:21:09 -070057 - "dhcp-list"
Zack Williamsae17c502016-06-28 22:05:19 -070058 - "flows"
59 - "hosts"
60 - "log:display"
61 - "nodes"
62 - "ports"
63 - "summary"
Zack Williams4e5d1d22016-06-13 11:10:03 -070064
Zack Williams2bfbbd62016-06-13 10:18:19 -070065- name: XOS diag collection
Zack Williams04106732016-06-27 20:55:32 -070066 shell: "ssh ubuntu@xos-1 \"{{ item }}\" > ~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070067 with_items:
68 - "docker ps"
Zack Williamscb52e5b2016-06-13 11:25:29 -070069 - "arp -n"
70 - "ifconfig -a"
Zack Williams2bfbbd62016-06-13 10:18:19 -070071
Zack Williamsba7af9e2016-06-27 17:21:09 -070072- name: Copy/run/retrieve XOS docker logs
Zack Williams4e5d1d22016-06-13 11:10:03 -070073 command: "{{ item }}"
74 with_items:
75 - "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh"
76 - "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'"
Zack Williams04106732016-06-27 20:55:32 -070077 - "rsync -avP ubuntu@xos-1:~/docker_logs/ ~/{{ diag_dir }}/xos/"
Zack Williamscb52e5b2016-06-13 11:25:29 -070078