--- - name: "Run ci/playbooks/e2e-collect-logs.yml" hosts: "{{ cifmw_zuul_target_host | default('all') }}" gather_facts: true tasks: - name: Filter out host if needed when: - cifmw_zuul_target_host is defined - cifmw_zuul_target_host != 'all' - inventory_hostname != cifmw_zuul_target_host ansible.builtin.meta: end_host - name: Ensure we have the ci-framework on host register: cifmw_status ansible.builtin.stat: path: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework" - name: End host if no basedir when: - not cifmw_status.stat.exists ansible.builtin.meta: end_host - name: Read base centos-9 scenarios vars: included_file: > {{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ ci-framework/scenarios/centos-9/base.yml ansible.builtin.include_role: name: cifmw_helpers tasks_from: include_file.yml - name: Run log collection ansible.builtin.import_role: name: cifmw_setup tasks_from: run_logs.yml tags: - logs environment: ANSIBLE_LOG_PATH: "{{ ansible_user_dir }}/ci-framework-data/logs/e2e-collect-logs-must-gather.log" - name: "Run ci/playbooks/e2e-collect-logs.yml on CRC host" hosts: crc gather_facts: false tasks: - name: Get kubelet journalctl logs ignore_errors: true # noqa: ignore-errors become: true ansible.builtin.shell: | journalctl -u kubelet > kubelet.log no_log: "{{ cifmw_nolog | default(true) | bool }}" args: chdir: "{{ ansible_user_dir }}/zuul-output/logs/" - name: Compress logs bigger than 2MB when: cifmw_compress_all_logs | default(true) ansible.builtin.shell: > find "{{ ansible_user_dir }}/zuul-output/" -type f ! -name "*.gz" ! -name "*.xz" -size +2M -exec gzip --best "{}" + ignore_errors: true # noqa: ignore-errors - name: Copy files from workspace on node vars: work_dir: "{{ ansible_user_dir }}/zuul-output/logs" ansible.builtin.include_role: name: fetch-output ignore_errors: true # noqa: ignore-errors