summaryrefslogtreecommitdiffstats
path: root/lib/ansible
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-11-27 15:22:25 -0500
committerTim Rozet <trozet@redhat.com>2018-04-04 16:03:49 -0400
commit382fa452e0c9a8189911f615416e1b24badaf5e4 (patch)
tree41973e70a7b054b4a2297bb45918430c0614c9ee /lib/ansible
parentb047099b609eac330486f23913e8046d0f22c1ab (diff)
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 <trozet@redhat.com>
Diffstat (limited to 'lib/ansible')
-rw-r--r--lib/ansible/playbooks/fetch_overcloud_logs.yml25
-rw-r--r--lib/ansible/playbooks/fetch_overcloud_nodes.yml13
2 files changed, 38 insertions, 0 deletions
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"