Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 1 | --- |
| 2 | # head-diag/tasks/main.yml |
| 3 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 4 | - name: Create diag_dir subdirs |
| 5 | file: |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 6 | dest="~/{{ diag_dir }}/{{ item }}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 7 | state=directory |
| 8 | with_items: |
Zack Williams | 5f7c60e | 2016-07-26 14:50:30 -0700 | [diff] [blame] | 9 | - head |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 10 | - juju |
| 11 | - openstack |
| 12 | - onos |
| 13 | - xos |
| 14 | |
Zack Williams | 5f7c60e | 2016-07-26 14:50:30 -0700 | [diff] [blame] | 15 | - name: Head node diag collection |
| 16 | shell: "{{ item }} > ~/{{ diag_dir }}/head/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 17 | with_items: |
| 18 | - "ifconfig -a" |
| 19 | - "route -n" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 20 | - "arp -n" |
Zack Williams | 5f7c60e | 2016-07-26 14:50:30 -0700 | [diff] [blame] | 21 | - "date" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 22 | - "brctl show" |
| 23 | - "cat /etc/resolv.conf" |
Zack Williams | 5f7c60e | 2016-07-26 14:50:30 -0700 | [diff] [blame] | 24 | - "cat /etc/lsb-release" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 25 | - "sudo uvt-kvm list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 26 | |
| 27 | - name: Juju diag collection |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 28 | shell: "{{ item }} > ~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 29 | with_items: |
| 30 | - "juju status --format=summary" |
| 31 | - "juju status --format=json" |
| 32 | |
| 33 | - name: OpenStack diag collection |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 34 | shell: "source ~/admin-openrc.sh && {{ item }} > ~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 35 | args: |
| 36 | executable: "/bin/bash" |
| 37 | with_items: |
Zack Williams | a653646 | 2016-06-13 13:13:33 -0700 | [diff] [blame] | 38 | - "glance image-list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 39 | - "nova list --all-tenants" |
Zack Williams | 85fd304 | 2016-06-13 13:47:58 -0700 | [diff] [blame] | 40 | - "nova host-list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 41 | - "keystone tenant-list" |
Zack Williams | a653646 | 2016-06-13 13:13:33 -0700 | [diff] [blame] | 42 | - "keystone user-list" |
| 43 | - "neutron net-list" |
| 44 | - "neutron subnet-list" |
Zack Williams | 85fd304 | 2016-06-13 13:47:58 -0700 | [diff] [blame] | 45 | - "neutron port-list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 46 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 47 | - name: ONOS diag collection - REST API |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 48 | 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 Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 49 | with_items: |
| 50 | - "hosts" |
| 51 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 52 | - name: ONOS diag collection - ONOS CLI |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 53 | shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > ~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 54 | with_items: |
Zack Williams | ae17c50 | 2016-06-28 22:05:19 -0700 | [diff] [blame] | 55 | - "apps -s -a" |
| 56 | - "bundle:list" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 57 | - "cordvtn-node-check nova-compute-1" |
Zack Williams | ae17c50 | 2016-06-28 22:05:19 -0700 | [diff] [blame] | 58 | - "cordvtn-nodes" |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 59 | - "dhcp-list" |
Zack Williams | ae17c50 | 2016-06-28 22:05:19 -0700 | [diff] [blame] | 60 | - "flows" |
| 61 | - "hosts" |
| 62 | - "log:display" |
| 63 | - "nodes" |
| 64 | - "ports" |
| 65 | - "summary" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 66 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 67 | - name: XOS diag collection |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 68 | shell: "ssh ubuntu@xos-1 \"{{ item }}\" > ~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 69 | with_items: |
| 70 | - "docker ps" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 71 | - "arp -n" |
| 72 | - "ifconfig -a" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 73 | |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 74 | - name: Copy/run/retrieve XOS docker logs |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 75 | 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 Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 79 | - "rsync -avP ubuntu@xos-1:~/docker_logs/ ~/{{ diag_dir }}/xos/" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 80 | |