|
2 | 2 | - include_role: |
3 | 3 | name: cp4d-variables |
4 | 4 |
|
| 5 | +- set_fact: |
| 6 | + _from_oci: True |
| 7 | + |
| 8 | +- set_fact: |
| 9 | + _from_oci: False |
| 10 | + when: _cp_alt_repo_used | default(False) |
| 11 | + |
5 | 12 | # Get preview of case-download to ensure the patch files are downloaded when --dry-run was selected |
6 | 13 | - block: |
7 | 14 | - set_fact: |
8 | 15 | _case_download_command: "{{ lookup('template', 'case-download.j2') }}" |
9 | 16 | vars: |
10 | 17 | _p_preview: True |
11 | | - |
12 | 18 | - name: Run preview of download case files to obtain patch files |
13 | 19 | shell: | |
14 | 20 | {{ _case_download_command }} |
15 | 21 | failed_when: False |
16 | 22 | environment: |
17 | 23 | OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}" |
| 24 | + |
| 25 | + rescue: |
| 26 | + |
| 27 | + - set_fact: |
| 28 | + _from_oci: False |
| 29 | + |
| 30 | + - set_fact: |
| 31 | + _case_download_command: "{{ lookup('template', 'case-download.j2') }}" |
| 32 | + - name: Run preview of download case files to obtain patch files after failure from OCI download |
| 33 | + shell: | |
| 34 | + {{ _case_download_command }} |
| 35 | + failed_when: False |
| 36 | + environment: |
| 37 | + OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}" |
18 | 38 | when: cpd_dry_run | bool |
19 | 39 |
|
20 | | -- name: Generate case-download command to download case files |
21 | | - set_fact: |
22 | | - _case_download_command: "{{ lookup('template', 'case-download.j2') }}" |
| 40 | +- block: |
| 41 | + - name: Generate case-download command to download case files |
| 42 | + set_fact: |
| 43 | + _case_download_command: "{{ lookup('template', 'case-download.j2') }}" |
23 | 44 |
|
24 | | -- include_role: |
25 | | - name: run-command |
26 | | - vars: |
27 | | - _p_command_description: Download case files |
28 | | - _p_command: "{{ _case_download_command }}" |
29 | | - _p_command_log_file: "{{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-case-download.log" |
30 | | - _p_command_environment: |
31 | | - OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}" |
32 | | - _p_cpd_cli_manage: True |
| 45 | + - include_role: |
| 46 | + name: run-command |
| 47 | + vars: |
| 48 | + _p_command_description: Download case files |
| 49 | + _p_command: "{{ _case_download_command }}" |
| 50 | + _p_command_log_file: "{{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-case-download.log" |
| 51 | + _p_command_environment: |
| 52 | + OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}" |
| 53 | + _p_cpd_cli_manage: True |
| 54 | + |
| 55 | + rescue: |
| 56 | + - set_fact: |
| 57 | + _from_oci: False |
| 58 | + |
| 59 | + - name: Generate case-download command to download case files from GitHub after failure from OCI download |
| 60 | + set_fact: |
| 61 | + _case_download_command: "{{ lookup('template', 'case-download.j2') }}" |
| 62 | + |
| 63 | + - include_role: |
| 64 | + name: run-command |
| 65 | + vars: |
| 66 | + _p_command_description: Download case files from GitHub |
| 67 | + _p_command: "{{ _case_download_command }}" |
| 68 | + _p_command_log_file: "{{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-case-download.log" |
| 69 | + _p_command_environment: |
| 70 | + OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}" |
| 71 | + _p_cpd_cli_manage: True |
33 | 72 |
|
34 | 73 | - name: Remove {{ status_dir }}/work/offline to remove any previous CASE files |
35 | 74 | ansible.builtin.file: |
|
0 commit comments