Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preflight: Update the role to be able to run with dci container #508

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
src: "{{ partner_creds }}"
dest: "{{ preflight_tmp_dir.path }}/config.json"
mode: "0644"
remote_src: true
when: partner_creds | length

# Use custom certificate for self sign registry
Expand Down
2 changes: 2 additions & 0 deletions roles/preflight/tasks/prepare_custom_certificate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
src: "{{ preflight_custom_ca }}"
dest: "{{ preflight_ca_tmp_dir.path }}/ca.crt"
mode: "0644"
remote_src: true

- name: Copy ca in trusted directory
ansible.builtin.copy:
src: "{{ preflight_custom_ca }}"
dest: "/etc/pki/ca-trust/source/anchors/preflight_ca.crt"
mode: "0644"
remote_src: true
become: true

- name: Update trusted ca
Expand Down
1 change: 1 addition & 0 deletions roles/preflight/tasks/prepare_preflight_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
src: "{{ preflight_source_dir }}/"
dest: "{{ preflight_tmp_dir.path }}/preflight-source/"
mode: "0755"
remote_src: true

- name: Set preflight_image name
ansible.builtin.set_fact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
src: "{{ item.src }}"
dest: "{{ job_logs.path }}/{{ preflight_prefix }}_{{ item.path | regex_replace('/', '_') }}"
mode: "0644"
remote_src: true
with_filetree: # noqa: schema[moves]
- "{{ preflight_container_artifacts.path }}"
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
src: "{{ item.1.path }}"
dest: "{{ job_logs.path }}/{{ preflight_prefix }}"
mode: "0644"
remote_src: true
loop: "{{ preflight_files_context | subelements('files') }}"
when: "item.1.path | regex_search('\\.(json|log|xml)$')"

Expand Down
9 changes: 7 additions & 2 deletions roles/preflight/tasks/tests_preflight_check_operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,20 @@
jid: "{{ preflight_exec.ansible_job_id }}"
mode: cleanup

- name: Get preflight log files
ansible.builtin.find:
paths: "{{ preflight_operator_artifacts.path }}"
register: _preflight_operator_artifacts_logs

- name: Upload logs for preflight check operator into DCI
vars:
preflight_prefix: "preflight_operator_{{ operator.name }}"
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ job_logs.path }}/{{ preflight_prefix }}_{{ item | basename }}"
mode: "0644"
with_fileglob:
- "{{ preflight_operator_artifacts.path }}/*"
remote_src: true
loop: "{{ _preflight_operator_artifacts_logs | json_query('files[*].path') }}"

- name: Validate annotations.yaml
ansible.builtin.include_tasks: test_validate_annotations.yml
Expand Down
Loading