blob: 8a8c7509c7b557f0d98ebe2e8ea4dfaf81c79636 [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
13 - xos
14
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 Williams2bfbbd62016-06-13 10:18:19 -070028
29- name: Juju diag collection
Zack Williams04106732016-06-27 20:55:32 -070030 shell: "{{ item }} > ~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams35624562016-08-28 17:12:26 -070031 args:
32 creates: "~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070033 with_items:
34 - "juju status --format=summary"
35 - "juju status --format=json"
36
37- name: OpenStack diag collection
Zack Williams04106732016-06-27 20:55:32 -070038 shell: "source ~/admin-openrc.sh && {{ item }} > ~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070039 args:
40 executable: "/bin/bash"
Zack Williams35624562016-08-28 17:12:26 -070041 creates: "~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070042 with_items:
Zack Williamsa6536462016-06-13 13:13:33 -070043 - "glance image-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070044 - "nova list --all-tenants"
Zack Williams85fd3042016-06-13 13:47:58 -070045 - "nova host-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070046 - "keystone tenant-list"
Zack Williamsa6536462016-06-13 13:13:33 -070047 - "keystone user-list"
48 - "neutron net-list"
49 - "neutron subnet-list"
Zack Williams85fd3042016-06-13 13:47:58 -070050 - "neutron port-list"
Zack Williams2bfbbd62016-06-13 10:18:19 -070051
Zack Williams4e5d1d22016-06-13 11:10:03 -070052- name: ONOS diag collection - REST API
Zack Williams04106732016-06-27 20:55:32 -070053 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 -070054 args:
55 creates: "~/{{ diag_dir }}/onos/rest_{{ item | regex_replace('[^\\w-]', '_')}}"
56 warn: False # get_url or uri can't easily redirect to a file
Zack Williams2bfbbd62016-06-13 10:18:19 -070057 with_items:
58 - "hosts"
59
Zack Williams4e5d1d22016-06-13 11:10:03 -070060- name: ONOS diag collection - ONOS CLI
Zack Williams04106732016-06-27 20:55:32 -070061 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 -070062 args:
63 creates: "~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams4e5d1d22016-06-13 11:10:03 -070064 with_items:
Zack Williamsae17c502016-06-28 22:05:19 -070065 - "apps -s -a"
66 - "bundle:list"
Zack Williams4e5d1d22016-06-13 11:10:03 -070067 - "cordvtn-node-check nova-compute-1"
Zack Williamsae17c502016-06-28 22:05:19 -070068 - "cordvtn-nodes"
Zack Williamsba7af9e2016-06-27 17:21:09 -070069 - "dhcp-list"
Zack Williamsae17c502016-06-28 22:05:19 -070070 - "flows"
71 - "hosts"
72 - "log:display"
73 - "nodes"
74 - "ports"
75 - "summary"
Zack Williams4e5d1d22016-06-13 11:10:03 -070076
Zack Williams2bfbbd62016-06-13 10:18:19 -070077- name: XOS diag collection
Zack Williams04106732016-06-27 20:55:32 -070078 shell: "ssh ubuntu@xos-1 \"{{ item }}\" > ~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams35624562016-08-28 17:12:26 -070079 args:
80 creates: "~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
Zack Williams2bfbbd62016-06-13 10:18:19 -070081 with_items:
82 - "docker ps"
Zack Williamscb52e5b2016-06-13 11:25:29 -070083 - "arp -n"
84 - "ifconfig -a"
Zack Williams2bfbbd62016-06-13 10:18:19 -070085
Zack Williamsba7af9e2016-06-27 17:21:09 -070086- name: Copy/run/retrieve XOS docker logs
Zack Williams4e5d1d22016-06-13 11:10:03 -070087 command: "{{ item }}"
Zack Williams35624562016-08-28 17:12:26 -070088 tags:
89 - skip_ansible_lint # don't know the name of docker containers for all configurations
Zack Williams4e5d1d22016-06-13 11:10:03 -070090 with_items:
91 - "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh"
92 - "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'"
Zack Williams04106732016-06-27 20:55:32 -070093 - "rsync -avP ubuntu@xos-1:~/docker_logs/ ~/{{ diag_dir }}/xos/"
Zack Williamscb52e5b2016-06-13 11:25:29 -070094