|
1 | 1 | ---
|
| 2 | + |
2 | 3 | - name: Create example-cnf facts
|
3 | 4 | set_fact:
|
4 | 5 | app_version: v0.2.6
|
|
73 | 74 | when:
|
74 | 75 | - dci_change_dir is defined
|
75 | 76 |
|
| 77 | +- name: Create the preflight_operators_to_certify variable |
| 78 | + when: |
| 79 | + - certify_operators is defined |
| 80 | + - certify_operators | bool |
| 81 | + - example_cnf_index_image is defined |
| 82 | + block: |
| 83 | + - name: Get Catalog Data |
| 84 | + ansible.builtin.shell: |
| 85 | + cmd: > |
| 86 | + set -e -o pipefail; |
| 87 | + ~/clusterconfigs-{{ cluster_name }}/opm render |
| 88 | + {% if mc_pullsecret is defined %} |
| 89 | + --authfile {{ mc_pullsecret }} |
| 90 | + {% endif %} |
| 91 | + {{ example_cnf_index_image }} | |
| 92 | + jq -r '.relatedImages[].image' |
| 93 | + args: |
| 94 | + executable: /bin/bash |
| 95 | + register: catalog_data_cmd |
| 96 | + retries: 1 |
| 97 | + delay: 5 |
| 98 | + until: |
| 99 | + - catalog_data_cmd.rc == 0 |
| 100 | + |
| 101 | + - name: Create an empty preflight_operators_to_certify variable |
| 102 | + ansible.builtin.set_fact: |
| 103 | + preflight_operators_to_certify: [] |
| 104 | + |
| 105 | + - name: Populate the preflight_operators_to_certify variable |
| 106 | + ansible.builtin.set_fact: |
| 107 | + preflight_operators_to_certify: "{{ preflight_operators_to_certify + [dict(bundle_image=item, index_image=example_cnf_index_image)] }}" |
| 108 | + when: '"bundle@" in item' |
| 109 | + loop: "{{ catalog_data_cmd.stdout_lines }}" |
| 110 | + |
| 111 | + - name: Display the prefight_operators_to_certify variable |
| 112 | + ansible.builtin.debug: |
| 113 | + msg: "{{ preflight_operators_to_certify }}" |
| 114 | + |
76 | 115 | - name: "Create CNF Namespace"
|
77 | 116 | community.kubernetes.k8s:
|
78 | 117 | state: present
|
|
0 commit comments