Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 1 | --- |
| 2 | # head-diag/tasks/main.yml |
| 3 | |
| 4 | - name: Create diag_dir fact |
| 5 | set_fact: diag_dir="~/diag-{{ ansible_date_time.iso8601_basic_short }}" |
| 6 | |
| 7 | - name: Create diag_dir subdirs |
| 8 | file: |
| 9 | dest="{{ diag_dir }}/{{ item }}" |
| 10 | state=directory |
| 11 | with_items: |
| 12 | - net |
| 13 | - juju |
| 14 | - openstack |
| 15 | - onos |
| 16 | - xos |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 17 | - nova-compute |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 18 | |
| 19 | - name: Networking diag collection |
| 20 | shell: "{{ item }} > {{ diag_dir }}/net/{{ item | regex_replace('[^\\w-]', '_')}}" |
| 21 | with_items: |
| 22 | - "ifconfig -a" |
| 23 | - "route -n" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 24 | - "arp -n" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 25 | - "brctl show" |
| 26 | - "cat /etc/resolv.conf" |
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 |
| 30 | shell: "{{ item }} > {{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}" |
| 31 | with_items: |
| 32 | - "juju status --format=summary" |
| 33 | - "juju status --format=json" |
| 34 | |
| 35 | - name: OpenStack diag collection |
| 36 | shell: "source ~/admin-openrc.sh && {{ item }} > {{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}" |
| 37 | args: |
| 38 | executable: "/bin/bash" |
| 39 | with_items: |
| 40 | - "nova image-list" |
| 41 | - "nova list --all-tenants" |
| 42 | - "keystone tenant-list" |
| 43 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 44 | - name: ONOS diag collection - REST API |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 45 | 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] | 46 | with_items: |
| 47 | - "hosts" |
| 48 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 49 | - name: ONOS diag collection - ONOS CLI |
| 50 | shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > {{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}" |
| 51 | with_items: |
| 52 | - "cordvtn-nodes" |
| 53 | - "cordvtn-node-check nova-compute-1" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 54 | - "hosts" |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 55 | |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 56 | - name: XOS diag collection |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 57 | 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] | 58 | with_items: |
| 59 | - "docker ps" |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 60 | - "arp -n" |
| 61 | - "ifconfig -a" |
Zack Williams | 2bfbbd6 | 2016-06-13 10:18:19 -0700 | [diff] [blame] | 62 | |
Zack Williams | 4e5d1d2 | 2016-06-13 11:10:03 -0700 | [diff] [blame] | 63 | - name: Copy and run XOS docker logs script |
| 64 | command: "{{ item }}" |
| 65 | with_items: |
| 66 | - "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh" |
| 67 | - "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'" |
| 68 | |
| 69 | - name: XOS docker logs retrieval |
| 70 | command: "rsync -avP ubuntu@xos-1:~/docker_logs/ {{ diag_dir }}/xos/" |
| 71 | |
Zack Williams | cb52e5b | 2016-06-13 11:25:29 -0700 | [diff] [blame] | 72 | |
| 73 | - name: nova-compute diag collection |
| 74 | shell: "ssh ubuntu@nova-compute-1 \"{{ item }}\" > {{ diag_dir }}/nova-compute/{{ item | regex_replace('[^\\w-]', '_')}}" |
| 75 | with_items: |
| 76 | - "arp -n" |
| 77 | - "brctl show" |
| 78 | - "ifconfig -a" |
| 79 | - "ping -c 3 172.27.0.2" |
| 80 | - "route -n" |
| 81 | |