2018-11-12 14:22:32 +11:00
|
|
|
- hosts: localhost
|
|
|
|
tasks:
|
2018-12-13 09:53:47 +11:00
|
|
|
- name: Make log directories for testing hosts
|
|
|
|
file:
|
2019-04-02 12:59:06 +11:00
|
|
|
path: "{{ zuul.executor.log_root }}/{{ item }}/logs"
|
2018-12-13 09:53:47 +11:00
|
|
|
state: directory
|
|
|
|
recurse: true
|
|
|
|
loop: "{{ query('inventory_hostnames', 'all') }}"
|
|
|
|
|
|
|
|
- hosts: all
|
|
|
|
tasks:
|
2020-01-09 19:47:10 -05:00
|
|
|
- include_role:
|
|
|
|
name: collect-container-logs
|
2020-03-02 15:38:00 -08:00
|
|
|
# The zuul user isn't part of the docker group on our fake
|
|
|
|
# production systems. Work around this by operating as root
|
|
|
|
# when collecting logs. This collects podman containers
|
|
|
|
# running as root; we may need to think about some flags for
|
|
|
|
# this role for collecting logs from containers under other
|
|
|
|
# users.
|
|
|
|
apply:
|
|
|
|
become: yes
|
2020-01-09 19:47:10 -05:00
|
|
|
vars:
|
|
|
|
container_command: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
- docker
|
|
|
|
- podman
|
2019-01-31 09:25:46 -08:00
|
|
|
|
2019-01-30 13:56:43 -08:00
|
|
|
- include_role:
|
|
|
|
name: stage-output
|
2018-11-12 14:22:32 +11:00
|
|
|
|
2018-08-28 13:09:53 -04:00
|
|
|
- hosts: bridge.openstack.org
|
|
|
|
tasks:
|
2018-11-12 14:22:32 +11:00
|
|
|
- name: Set log directory
|
|
|
|
set_fact:
|
2019-04-02 12:59:06 +11:00
|
|
|
log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
|
2018-11-12 14:22:32 +11:00
|
|
|
|
2020-08-21 14:08:49 +10:00
|
|
|
- name: Collect tox output
|
|
|
|
include_role:
|
|
|
|
name: fetch-tox-output
|
|
|
|
vars:
|
|
|
|
tox_envlist: testinfra
|
|
|
|
zuul_work_dir: src/opendev.org/opendev/system-config
|
|
|
|
|
2018-11-12 14:22:32 +11:00
|
|
|
# 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
|
|
|
|
|
2019-11-19 17:46:19 -05:00
|
|
|
- name: Generate ARA static report
|
|
|
|
command: ara-manage generate /root/.ara/static
|
|
|
|
become: yes
|
2020-07-24 17:54:15 +00:00
|
|
|
|
2019-11-19 17:46:19 -05:00
|
|
|
- name: Collect testing ARA results
|
|
|
|
synchronize:
|
|
|
|
dest: "{{ log_dir }}/ara-report"
|
|
|
|
mode: pull
|
|
|
|
src: "/root/.ara/static/"
|
|
|
|
verify_host: true
|
|
|
|
become: yes
|
|
|
|
ignore_errors: true
|
2018-11-12 14:22:32 +11:00
|
|
|
|
2021-06-02 05:58:11 +10:00
|
|
|
- name: Add ARA artifact
|
|
|
|
zuul_return:
|
|
|
|
data:
|
|
|
|
zuul:
|
|
|
|
artifacts:
|
|
|
|
- name: ARA report
|
|
|
|
url: "bridge.openstack.org/ara-report/"
|
|
|
|
|
2018-08-30 09:30:59 -07:00
|
|
|
- name: Collect ansible configuration
|
|
|
|
synchronize:
|
2018-11-12 14:22:32 +11:00
|
|
|
dest: "{{ log_dir }}/etc"
|
2018-08-30 09:30:59 -07:00
|
|
|
mode: pull
|
|
|
|
src: "/etc/ansible"
|
|
|
|
verify_host: true
|
2018-08-30 11:05:49 -07:00
|
|
|
rsync_opts:
|
|
|
|
- "--exclude=__pycache__"
|
2018-08-30 09:30:59 -07:00
|
|
|
ignore_errors: true
|