|
14 | 14 | # License for the specific language governing permissions and limitations |
15 | 15 | # under the License. |
16 | 16 |
|
| 17 | +- name: Load architecture automation file |
| 18 | + register: _automation |
| 19 | + ansible.builtin.slurp: |
| 20 | + path: "{{ cifmw_architecture_automation_file }}" |
| 21 | + |
| 22 | +- name: Prepare automation data |
| 23 | + vars: |
| 24 | + _parsed: "{{ _automation.content | b64decode | from_yaml }}" |
| 25 | + ansible.builtin.set_fact: |
| 26 | + cifmw_deploy_architecture_steps: >- |
| 27 | + {{ _parsed['vas'][cifmw_architecture_scenario] }} |
| 28 | +
|
| 29 | +- name: Generate list of CRs to delete |
| 30 | + vars: |
| 31 | + _stages_crs: >- |
| 32 | + {{ |
| 33 | + cifmw_deploy_architecture_steps['stages'] | |
| 34 | + reverse | |
| 35 | + selectattr('build_output', 'defined') | |
| 36 | + map(attribute='build_output') | |
| 37 | + list |
| 38 | + }} |
| 39 | + _stages_crs_path: >- |
| 40 | + {{ |
| 41 | + [cifmw_kustomize_deploy_kustomizations_dest_dir] |
| 42 | + | product(_stages_crs) |
| 43 | + | map('join', '/') |
| 44 | + | unique |
| 45 | + }} |
| 46 | + _operators_crs: |
| 47 | + - "{{ cifmw_kustomize_deploy_nmstate_dest_file }}" |
| 48 | + - "{{ cifmw_kustomize_deploy_metallb_dest_file }}" |
| 49 | + - "{{ cifmw_kustomize_deploy_kustomizations_dest_dir }}/openstack.yaml" |
| 50 | + - "{{ cifmw_kustomize_deploy_olm_dest_file }}" |
| 51 | + register: _cifmw_kustomize_files |
| 52 | + ansible.builtin.set_fact: |
| 53 | + cifmw_kustomize_deploy_crs_to_delete: >- |
| 54 | + {{ |
| 55 | + _stages_crs_path + |
| 56 | + _operators_crs |
| 57 | + }} |
| 58 | +
|
17 | 59 | - name: Ensure that kustomization files are present |
18 | 60 | ansible.builtin.stat: |
19 | 61 | path: "{{ item }}" |
20 | | - loop: |
21 | | - - "{{ cifmw_kustomize_deploy_cp_dest_file }}" |
22 | | - - "{{ cifmw_kustomize_deploy_nmstate_dest_file }}" |
23 | | - - "{{ cifmw_kustomize_deploy_metallb_dest_file }}" |
24 | | - - "{{ cifmw_kustomize_deploy_olm_dest_file }}" |
| 62 | + loop: "{{ cifmw_kustomize_deploy_crs_to_delete }}" |
25 | 63 | register: _cifmw_kustomize_files |
26 | 64 |
|
27 | 65 | - name: Cleaning operators resources |
|
0 commit comments