blob: 065889e4777ba498189a385975d5a8e9be793875 [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 Williamsdc4878f2016-07-26 14:50:30 -07009 - head
Zack Williams2bfbbd62016-06-13 10:18:19 -070010 - juju
11 - openstack
12 - onos
Zack Williams682450e2016-11-19 09:04:41 -070013 - docker
Zack Williams2bfbbd62016-06-13 10:18:19 -070014
Zack Williamsdc4878f2016-07-26 14:50:30 -070015- name: Head node diag collection
16 shell: "{{ item }} > ~/{{ diag_dir }}/head/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams35624562016-08-28 17:12:26 -070017 args:
18 creates: "~/{{ diag_dir }}/head/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070019 with_items:
20 - "ifconfig -a"
21 - "route -n"
Zack Williamscb52e5b2016-06-13 11:25:29 -070022 - "arp -n"
Zack Williamsdc4878f2016-07-26 14:50:30 -070023 - "date"
Zack Williams2bfbbd62016-06-13 10:18:19 -070024 - "brctl show"
25 - "cat /etc/resolv.conf"
Zack Williamsdc4878f2016-07-26 14:50:30 -070026 - "cat /etc/lsb-release"
Zack Williamscb52e5b2016-06-13 11:25:29 -070027 - "sudo uvt-kvm list"
Zack Williams682450e2016-11-19 09:04:41 -070028 - "sudo virsh list"
29 - "sudo docker ps"
Zack Williams2bfbbd62016-06-13 10:18:19 -070030
31- name: Juju diag collection
Zack Williams04106732016-06-27 20:55:32 -070032 shell: "{{ item }} > ~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams35624562016-08-28 17:12:26 -070033 args:
34 creates: "~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070035 with_items:
36 - "juju status --format=summary"
37 - "juju status --format=json"
38
39- name: OpenStack diag collection
Zack Williams04106732016-06-27 20:55:32 -070040 shell: "source ~/admin-openrc.sh && {{ item }} > ~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070041 args:
42 executable: "/bin/bash"
Zack Williams35624562016-08-28 17:12:26 -070043 creates: "~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070044 with_items:
Zack Williamsa6536462016-06-13 13:13:33 -070045 - "glance image-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070046 - "nova list --all-tenants"
Zack Williams85fd3042016-06-13 13:47:58 -070047 - "nova host-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070048 - "keystone tenant-list"
Zack Williamsa6536462016-06-13 13:13:33 -070049 - "keystone user-list"
50 - "neutron net-list"
51 - "neutron subnet-list"
Zack Williams85fd3042016-06-13 13:47:58 -070052 - "neutron port-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070053
Zack Williams4e5d1d22016-06-13 11:10:03 -070054- name: ONOS diag collection - REST API
Zack Williams04106732016-06-27 20:55:32 -070055 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 Williams35624562016-08-28 17:12:26 -070056 args:
57 creates: "~/{{ diag_dir }}/onos/rest_{{ item | regex_replace('[^\\w-]', '_')}}"
58 warn: False # get_url or uri can't easily redirect to a file
Zack Williams2bfbbd62016-06-13 10:18:19 -070059 with_items:
60 - "hosts"
61
Zack Williams4e5d1d22016-06-13 11:10:03 -070062- name: ONOS diag collection - ONOS CLI
Zack Williams04106732016-06-27 20:55:32 -070063 shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > ~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
Zack Williams35624562016-08-28 17:12:26 -070064 args:
65 creates: "~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams4e5d1d22016-06-13 11:10:03 -070066 with_items:
Zack Williamsae17c502016-06-28 22:05:19 -070067 - "apps -s -a"
68 - "bundle:list"
Zack Williams4e5d1d22016-06-13 11:10:03 -070069 - "cordvtn-node-check nova-compute-1"
Zack Williamsae17c502016-06-28 22:05:19 -070070 - "cordvtn-nodes"
Zack Williams682450e2016-11-19 09:04:41 -070071 - "cordvtn-networks"
72 - "cordvtn-ports"
Zack Williamsba7af9e2016-06-27 17:21:09 -070073 - "dhcp-list"
Zack Williamsae17c502016-06-28 22:05:19 -070074 - "flows"
75 - "hosts"
76 - "log:display"
77 - "nodes"
78 - "ports"
79 - "summary"
Zack Williams4e5d1d22016-06-13 11:10:03 -070080
Zack Williams682450e2016-11-19 09:04:41 -070081- name: Docker diag collection - Find names for all running Docker containers
82 shell: "sudo docker ps --format '{{ '{{' }} .Names {{ '}}' }}'"
83 register: docker_containers
Zack Williams35624562016-08-28 17:12:26 -070084 tags:
Zack Williams682450e2016-11-19 09:04:41 -070085 - skip_ansible_lint # collecting docker container names
86
87- name: Docker diag collection - Collect logs from Docker containers
88 shell: "sudo docker logs {{ item }} > ~/{{ diag_dir }}/docker/{{ item | regex_replace('[^\\w-]', '_')}} 2>&1"
89 args:
90 creates: "~/{{ diag_dir }}/docker/{{ item | regex_replace('[^\\w-]', '_')}}"
91 with_items: "{{ docker_containers.stdout.split('\n') }}"
92 tags:
93 - skip_ansible_lint # ansible-lint interprets the \n incorrectly
94
Zack Williamscb52e5b2016-06-13 11:25:29 -070095