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 | dc4878f | 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 | dc4878f | 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 | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 17 | args: |
| 18 | creates: "~/{{ diag_dir }}/head/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 19 | with_items: |
| 20 | - "ifconfig -a" |
| 21 | - "route -n" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 22 | - "arp -n" |
Zack Williams | dc4878f | 2016-07-26 14:50:30 -0700 | [diff] [blame] | 23 | - "date" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 24 | - "brctl show" |
| 25 | - "cat /etc/resolv.conf" |
Zack Williams | dc4878f | 2016-07-26 14:50:30 -0700 | [diff] [blame] | 26 | - "cat /etc/lsb-release" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 27 | - "sudo uvt-kvm list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 28 | |
| 29 | - name: Juju diag collection |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 30 | shell: "{{ item }} > ~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 31 | args: |
| 32 | creates: "~/{{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 33 | with_items: |
| 34 | - "juju status --format=summary" |
| 35 | - "juju status --format=json" |
| 36 | |
| 37 | - name: OpenStack diag collection |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 38 | 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] | 39 | args: |
| 40 | executable: "/bin/bash" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 41 | creates: "~/{{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 42 | with_items: |
Zack Williams | a653646 | 2016-06-13 13:13:33 -0700 | [diff] [blame] | 43 | - "glance image-list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 44 | - "nova list --all-tenants" |
Zack Williams | 85fd304 | 2016-06-13 13:47:58 -0700 | [diff] [blame] | 45 | - "nova host-list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 46 | - "keystone tenant-list" |
Zack Williams | a653646 | 2016-06-13 13:13:33 -0700 | [diff] [blame] | 47 | - "keystone user-list" |
| 48 | - "neutron net-list" |
| 49 | - "neutron subnet-list" |
Zack Williams | 85fd304 | 2016-06-13 13:47:58 -0700 | [diff] [blame] | 50 | - "neutron port-list" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 51 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 52 | - name: ONOS diag collection - REST API |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 53 | 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 | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 54 | 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 Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 57 | with_items: |
| 58 | - "hosts" |
| 59 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 60 | - name: ONOS diag collection - ONOS CLI |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 61 | shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > ~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 62 | args: |
| 63 | creates: "~/{{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 64 | with_items: |
Zack Williams | ae17c50 | 2016-06-28 22:05:19 -0700 | [diff] [blame] | 65 | - "apps -s -a" |
| 66 | - "bundle:list" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 67 | - "cordvtn-node-check nova-compute-1" |
Zack Williams | ae17c50 | 2016-06-28 22:05:19 -0700 | [diff] [blame] | 68 | - "cordvtn-nodes" |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 69 | - "dhcp-list" |
Zack Williams | ae17c50 | 2016-06-28 22:05:19 -0700 | [diff] [blame] | 70 | - "flows" |
| 71 | - "hosts" |
| 72 | - "log:display" |
| 73 | - "nodes" |
| 74 | - "ports" |
| 75 | - "summary" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 76 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 77 | - name: XOS diag collection |
Zack Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 78 | shell: "ssh ubuntu@xos-1 \"{{ item }}\" > ~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 79 | args: |
| 80 | creates: "~/{{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 81 | with_items: |
| 82 | - "docker ps" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 83 | - "arp -n" |
| 84 | - "ifconfig -a" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 85 | |
Zack Williams | ba7af9e | 2016-06-27 17:21:09 -0700 | [diff] [blame] | 86 | - name: Copy/run/retrieve XOS docker logs |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 87 | command: "{{ item }}" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 88 | tags: |
| 89 | - skip_ansible_lint # don't know the name of docker containers for all configurations |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 90 | 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 Williams | 0410673 | 2016-06-27 20:55:32 -0700 | [diff] [blame] | 93 | - "rsync -avP ubuntu@xos-1:~/docker_logs/ ~/{{ diag_dir }}/xos/" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 94 | |