|
30 | 30 | matching_images: "{{ site_vars | dict2items | selectattr('key', 'match', 'ubuntu*') | list }}"
|
31 | 31 | when: site_vars is defined and site_vars | length > 0
|
32 | 32 |
|
| 33 | + - name: Fetch capi-helm-charts version |
| 34 | + shell: "curl -s --url \"https://api.github.com/repos/stackhpc/capi-helm-charts/releases/latest\" --header \"Authorization: Bearer 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\" | grep tag_name | awk -F '\"' '{print $4}' " |
| 35 | + register: helm_chart_version |
| 36 | + changed_when: false |
| 37 | + |
| 38 | + - name: Fetch dependencies.json using wget |
| 39 | + shell: 'wget -O - "https://github.com/stackhpc/capi-helm-charts/releases/download/{{ helm_chart_version.stdout }}/dependencies.json" ' |
| 40 | + register: dependencies_response |
| 41 | + changed_when: false |
| 42 | + |
| 43 | + - name: Parse JSON response |
| 44 | + set_fact: |
| 45 | + dependencies: "{{ dependencies_response.stdout | from_json | dict2items | list }}" |
| 46 | + |
| 47 | + # - name: Fetch manifest.json using wget |
| 48 | + # shell: "wget -O - https://github.com/stackhpc/azimuth-images/releases/download/0.1.2/manifest.json" |
| 49 | + # register: manifest_response |
| 50 | + # changed_when: false |
| 51 | + |
33 | 52 | - name: Fetch manifest.json using wget
|
34 |
| - shell: "wget -O - 'https://github.com/stackhpc/azimuth-images/releases/download/0.1.2/manifest.json'" |
| 53 | + shell: "wget -O - https://github.com/stackhpc/azimuth-images/releases/download/{{ dependencies | json_query('[?key==`azimuth-images`].value | [0]') }}/manifest.json" |
35 | 54 | register: manifest_response
|
36 | 55 | changed_when: false
|
37 | 56 |
|
38 | 57 | - name: Parse JSON response
|
39 | 58 | set_fact:
|
40 | 59 | new_template_data: "{{ manifest_response.stdout | from_json | dict2items | selectattr('key', 'match', 'kubernetes*') | list }}"
|
41 | 60 |
|
| 61 | + - debug: |
| 62 | + var: new_template_data |
| 63 | + |
42 | 64 | - name: Template images & templates
|
43 | 65 | template:
|
44 | 66 | src: "{{ root_dir }}/examples/templates/capi-images-templates.j2"
|
|
0 commit comments