blob: 1dd4a9b06f621d4089420e2c590a21c517e6b9e7 [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:
Zack Williams5f7c60e2016-07-26 14:50:30 -07009 - head
Zack Williams2bfbbd62016-06-13 10:18:19 -070010 - juju
11 - openstack
12 - onos
13 - xos
14
Zack Williams5f7c60e2016-07-26 14:50:30 -070015- name: Head node diag collection
16 shell: "{{ item }} > ~/{{ diag_dir }}/head/{{ 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 Williams5f7c60e2016-07-26 14:50:30 -070021 - "date"
Zack Williams2bfbbd62016-06-13 10:18:19 -070022 - "brctl show"
23 - "cat /etc/resolv.conf"
Zack Williams5f7c60e2016-07-26 14:50:30 -070024 - "cat /etc/lsb-release"
Zack Williamscb52e5b2016-06-13 11:25:29 -070025 - "sudo uvt-kvm list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070026
27- name: Juju diag collection
Zack Williams04106732016-06-27 20:55:32 -070028 shell: "{{ item }} > ~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070029 with_items:
30 - "juju status --format=summary"
31 - "juju status --format=json"
32
33- name: OpenStack diag collection
Zack Williams04106732016-06-27 20:55:32 -070034 shell: "source ~/admin-openrc.sh && {{ item }} > ~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070035 args:
36 executable: "/bin/bash"
37 with_items:
Zack Williamsa6536462016-06-13 13:13:33 -070038 - "glance image-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070039 - "nova list --all-tenants"
Zack Williams85fd3042016-06-13 13:47:58 -070040 - "nova host-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070041 - "keystone tenant-list"
Zack Williamsa6536462016-06-13 13:13:33 -070042 - "keystone user-list"
43 - "neutron net-list"
44 - "neutron subnet-list"
Zack Williams85fd3042016-06-13 13:47:58 -070045 - "neutron port-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070046
Zack Williams4e5d1d22016-06-13 11:10:03 -070047- name: ONOS diag collection - REST API
Zack Williams04106732016-06-27 20:55:32 -070048 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 -070049 with_items:
50 - "hosts"
51
Zack Williams4e5d1d22016-06-13 11:10:03 -070052- name: ONOS diag collection - ONOS CLI
Zack Williams04106732016-06-27 20:55:32 -070053 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 -070054 with_items:
Zack Williamsae17c502016-06-28 22:05:19 -070055 - "apps -s -a"
56 - "bundle:list"
Zack Williams4e5d1d22016-06-13 11:10:03 -070057 - "cordvtn-node-check nova-compute-1"
Zack Williamsae17c502016-06-28 22:05:19 -070058 - "cordvtn-nodes"
Zack Williamsba7af9e2016-06-27 17:21:09 -070059 - "dhcp-list"
Zack Williamsae17c502016-06-28 22:05:19 -070060 - "flows"
61 - "hosts"
62 - "log:display"
63 - "nodes"
64 - "ports"
65 - "summary"
Zack Williams4e5d1d22016-06-13 11:10:03 -070066
Zack Williams2bfbbd62016-06-13 10:18:19 -070067- name: XOS diag collection
Zack Williams04106732016-06-27 20:55:32 -070068 shell: "ssh ubuntu@xos-1 \"{{ item }}\" > ~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070069 with_items:
70 - "docker ps"
Zack Williamscb52e5b2016-06-13 11:25:29 -070071 - "arp -n"
72 - "ifconfig -a"
Zack Williams2bfbbd62016-06-13 10:18:19 -070073
Zack Williamsba7af9e2016-06-27 17:21:09 -070074- name: Copy/run/retrieve XOS docker logs
Zack Williams4e5d1d22016-06-13 11:10:03 -070075 command: "{{ item }}"
76 with_items:
77 - "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh"
78 - "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'"
Zack Williams04106732016-06-27 20:55:32 -070079 - "rsync -avP ubuntu@xos-1:~/docker_logs/ ~/{{ diag_dir }}/xos/"
Zack Williamscb52e5b2016-06-13 11:25:29 -070080