--- - name: Create crc logs directory ignore_errors: true # noqa: ignore-errors ansible.builtin.file: path: "{{ cifmw_artifacts_basedir }}/logs/crc" state: directory mode: "0755" - name: Ensure controller knows CRC ssh keys ignore_errors: true # noqa: ignore-errors register: crc_host_key ansible.builtin.shell: cmd: >- ssh-keyscan {{ cifmw_artifacts_crc_host }} >> ~/.ssh/known_hosts - name: Get CRC things only if we know it when: - crc_host_key is defined - crc_host_key.rc is defined - crc_host_key.rc == 0 block: - name: Recognize new keypair ansible.builtin.stat: path: "{{ cifmw_artifacts_crc_sshkey_ed25519 }}" register: _sshkeypair - name: Set fact if new keypair exists when: _sshkeypair.stat.exists ansible.builtin.set_fact: new_keypair_path: "{{ cifmw_artifacts_crc_sshkey_ed25519 }}" - name: Prepare root ssh accesses ignore_errors: true # noqa: ignore-errors cifmw.general.ci_script: output_dir: "{{ cifmw_artifacts_basedir }}/artifacts" script: |- ssh -i {{ new_keypair_path | default(cifmw_artifacts_crc_sshkey) }} {{ cifmw_artifacts_crc_user }}@{{ cifmw_artifacts_crc_host }} <- scp -v -r -i {{ new_keypair_path | default(cifmw_artifacts_crc_sshkey) }} core@{{ cifmw_artifacts_crc_host }}:/tmp/crc-logs-artifacts {{ cifmw_artifacts_basedir }}/logs/crc/