system-config/playbooks/zuul/run-base-post.yaml
Ian Wienand 3bed6e0fd3
Enable ARA reports for system-config bridge CI jobs
This change takes the ARA report from the "inner" run of the base
playbooks on our bridge.o.o node and publishes it into the final log
output.  This is then displayed by the middleware.

Create a new log hierarchy with a "bridge.o.o" to make it clear the
logs here are related to the test running on that node.  Move the
ansible config under there too.

Change-Id: I74122db09f0f712836a0ee820c6fac87c3c9c734
2018-12-04 17:46:47 -05:00

58 lines
1.6 KiB
YAML

- hosts: localhost
tasks:
- name: Ensure log directories exist
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ zuul.executor.log_root }}/bridge.o.o"
- "{{ zuul.executor.log_root }}/bridge.o.o/ara-report"
- hosts: bridge.openstack.org
tasks:
- name: Set log directory
set_fact:
log_dir: "{{ zuul.executor.log_root }}/bridge.o.o"
- name: Register junit.xml file
stat:
path: "{{ zuul.project.src_dir }}/junit.xml"
register: _junit
- name: Collect testinfra logs
synchronize:
dest: "{{ zuul.executor.log_root }}"
mode: pull
src: "{{ zuul.project.src_dir }}/junit.xml"
verify_host: true
when: _junit.stat.exists|bool
# Because during the test we run ansible as root, we need
# to allow ourselves permissions to copy the results
- name: Open ARA results permissions
file:
dest: /var/cache/ansible
mode: u=rwX,g=rX,o=rX
recurse: yes
become: yes
# Note called ansible.sqlite so the middleware on
# logs.o.o picks it up for display
- name: Collect testing ARA results
synchronize:
dest: "{{ log_dir }}/ara-report/ansible.sqlite"
mode: pull
src: "/var/cache/ansible/ara.sqlite"
verify_host: true
ignore_errors: true
- name: Collect ansible configuration
synchronize:
dest: "{{ log_dir }}/etc"
mode: pull
src: "/etc/ansible"
verify_host: true
rsync_opts:
- "--exclude=__pycache__"
ignore_errors: true