From 382fa452e0c9a8189911f615416e1b24badaf5e4 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Mon, 27 Nov 2017 15:22:25 -0500 Subject: Adds the ability to fetch logs from deployment Usage: opnfv-pyutil --fetch-logs python3 utils.py --fetch-logs --lib-dir ../lib Eventually all utils.sh functions will be migrated here. Note there is no support here for containers. Will be added later. Change-Id: I223b8592ad09e0370e287ee2801072db31f9aa12 Signed-off-by: Tim Rozet --- lib/ansible/playbooks/fetch_overcloud_logs.yml | 25 +++++++++++++++++++++++++ lib/ansible/playbooks/fetch_overcloud_nodes.yml | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/ansible/playbooks/fetch_overcloud_logs.yml create mode 100644 lib/ansible/playbooks/fetch_overcloud_nodes.yml (limited to 'lib') diff --git a/lib/ansible/playbooks/fetch_overcloud_logs.yml b/lib/ansible/playbooks/fetch_overcloud_logs.yml new file mode 100644 index 00000000..1ab52475 --- /dev/null +++ b/lib/ansible/playbooks/fetch_overcloud_logs.yml @@ -0,0 +1,25 @@ +--- +- hosts: all + tasks: + - name: Archive logs + archive: + path: + - /var/log + - /etc/puppet + - /etc/nova + - /etc/neutron + - /etc/heat + - /etc/haproxy + - /etc/glance + - /etc/puppet + - /etc/vpp + - /etc/os-net-config + - /opt/opendaylight/data/log + - /opt/opendaylight/etc + dest: /root/logging.tar.gz + become: yes + - name: Fetch /var/log/ + fetch: + src: /root/logging.tar.gz + dest: "{{ apex_temp_dir }}/" + become: yes diff --git a/lib/ansible/playbooks/fetch_overcloud_nodes.yml b/lib/ansible/playbooks/fetch_overcloud_nodes.yml new file mode 100644 index 00000000..bcb5f0f6 --- /dev/null +++ b/lib/ansible/playbooks/fetch_overcloud_nodes.yml @@ -0,0 +1,13 @@ +--- +- hosts: all + tasks: + - name: Get overcloud nodes and IPs + shell: "{{ stackrc }} && openstack server list -f json" + register: nova_list + - name: Write nova list output to file + local_action: copy content="{{ nova_list.stdout }}" dest="{{ apex_temp_dir }}/nova_output" + - name: Get ironic node information + shell: "{{ stackrc }} && openstack server list -f json" + register: ironic_list + - name: Write ironic list output to file + local_action: copy content="{{ ironic_list.stdout }}" dest="{{ apex_temp_dir }}/ironic_output" -- cgit 1.2.3-korg