blob: 0dc33624df5e63a7fc13e91b2083fa7d0d0d7b88 [file] [log] [blame]
---
# head-diag/tasks/main.yml
- name: Create diag_dir fact
set_fact: diag_dir="~/diag-{{ ansible_date_time.iso8601_basic_short }}"
- name: Create diag_dir subdirs
file:
dest="{{ diag_dir }}/{{ item }}"
state=directory
with_items:
- net
- juju
- openstack
- onos
- xos
- nova-compute
- name: Networking diag collection
shell: "{{ item }} > {{ diag_dir }}/net/{{ item | regex_replace('[^\\w-]', '_')}}"
with_items:
- "ifconfig -a"
- "route -n"
- "arp -n"
- "brctl show"
- "cat /etc/resolv.conf"
- "sudo uvt-kvm list"
- name: Juju diag collection
shell: "{{ item }} > {{ diag_dir }}/juju/{{ item | regex_replace('[^\\w-]', '_')}}"
with_items:
- "juju status --format=summary"
- "juju status --format=json"
- name: OpenStack diag collection
shell: "source ~/admin-openrc.sh && {{ item }} > {{ diag_dir }}/openstack/{{ item | regex_replace('[^\\w-]', '_')}}"
args:
executable: "/bin/bash"
with_items:
- "nova image-list"
- "nova list --all-tenants"
- "keystone tenant-list"
- name: ONOS diag collection - REST API
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-]', '_') }}"
with_items:
- "hosts"
- name: ONOS diag collection - ONOS CLI
shell: "sshpass -p 'karaf' ssh -p 8101 karaf@onos-cord {{ item }} > {{ diag_dir }}/onos/{{ item | regex_replace('[^\\w-]', '_') }}"
with_items:
- "cordvtn-nodes"
- "cordvtn-node-check nova-compute-1"
- "hosts"
- name: XOS diag collection
shell: "ssh ubuntu@xos-1 \"{{ item }}\" > {{ diag_dir }}/xos/{{ item | regex_replace('[^\\w-]', '_')}}"
with_items:
- "docker ps"
- "arp -n"
- "ifconfig -a"
- name: Copy and run XOS docker logs script
command: "{{ item }}"
with_items:
- "scp {{ role_path }}/files/docker_logs.sh ubuntu@xos-1:~/docker_logs.sh"
- "ssh ubuntu@xos-1 'bash ~/docker_logs.sh'"
- name: XOS docker logs retrieval
command: "rsync -avP ubuntu@xos-1:~/docker_logs/ {{ diag_dir }}/xos/"
- name: nova-compute diag collection
shell: "ssh ubuntu@nova-compute-1 \"{{ item }}\" > {{ diag_dir }}/nova-compute/{{ item | regex_replace('[^\\w-]', '_')}}"
with_items:
- "arp -n"
- "brctl show"
- "ifconfig -a"
- "ping -c 3 172.27.0.2"
- "route -n"