system-config/playbooks/zuul/run-base-post.yaml
2023-03-29 13:35:19 +02:00

53 lines
1.5 KiB
YAML

- hosts: localhost
tasks:
- name: Make log directories for testing hosts
ansible.builtin.file:
path: "{{ zuul.executor.log_root }}/{{ item }}/logs"
state: directory
recurse: true
loop: "{{ query('inventory_hostnames', 'all') }}"
- hosts: all
tasks:
- ansible.builtin.include_role:
name: collect-container-logs
# 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: true
vars:
container_command: "{{ item }}"
loop:
- docker
- podman
- ansible.builtin.include_role:
name: stage-output
- hosts: prod_bastion[0]
tasks:
- name: Set log directory
ansible.builtin.set_fact:
log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
- name: Collect tox output
ansible.builtin.include_role:
name: fetch-tox-output
vars:
tox_envlist: testinfra
zuul_work_dir: src/github.com/opentelekomcloud-infra/system-config
- name: Collect ansible configuration
ansible.posix.synchronize:
dest: "{{ log_dir }}/etc"
mode: pull
src: "/etc/ansible"
verify_host: true
rsync_opts:
- "--exclude=__pycache__"
ignore_errors: true