Merge "Grab logs in the case of errors"

This commit is contained in:
Zuul 2020-04-02 23:14:14 +00:00 committed by Gerrit Code Review
commit 6d8409f46e

View File

@ -15,6 +15,14 @@
- hosts: bridge.openstack.org
tasks:
- name: Ensure run dir
file:
state: directory
path: /var/run/ansible
- name: Run the production playbook and capture logs
block:
- name: Log a playbook start header
become: yes
shell: 'echo "Running {{ ansible_date_time.iso8601 }}: ansible-playbook -v -f {{ ansible_forks }} /opt/system-config/playbooks/{{ playbook_name }}" > /var/log/ansible/{{ playbook_name }}.log'
@ -23,6 +31,8 @@
become: yes
shell: 'ansible-playbook -v -f {{ ansible_forks }} /opt/system-config/playbooks/{{ playbook_name }} >> /var/log/ansible/{{ playbook_name }}.log'
always:
# Not using normal zuul job roles as bridge.openstack.org is not a
# test node with all the normal bits in place.
- name: Collect log output