- 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