|
52 | 52 | terrarium_docker_registry_config_path: /root/.docker/config.json |
53 | 53 | terrarium_docker_hardened_images: auto |
54 | 54 | terrarium_docker_hardened_image_mirrors: true |
| 55 | + terrarium_docker_hardened_image_arch_supported: "{{ ansible_architecture in ['x86_64', 'amd64'] }}" |
55 | 56 | terrarium_oauth2_proxy_image: "" |
56 | 57 | terrarium_oauth2_proxy_image_hardened: "dhi.io/oauth2-proxy:7.15.2-debian13@sha256:8f4e89762735e7ec7c3f1bbdd5da4dcd55358db8c3278bfbc2e46a7f86ab7d9e" |
57 | 58 | terrarium_oauth2_proxy_image_mirror: "ghcr.io/terion-name/terrarium-dhi-oauth2-proxy:7.15.2-debian13@sha256:8f4e89762735e7ec7c3f1bbdd5da4dcd55358db8c3278bfbc2e46a7f86ab7d9e" |
|
147 | 148 | path: "{{ terrarium_docker_registry_config_path }}" |
148 | 149 | register: terrarium_docker_registry_config |
149 | 150 | no_log: true |
| 151 | + - name: Assert hardened images support this host architecture |
| 152 | + ansible.builtin.assert: |
| 153 | + that: |
| 154 | + - terrarium_docker_hardened_image_arch_supported | bool |
| 155 | + fail_msg: "Pinned Docker Hardened Images currently support Terrarium's selected oauth2-proxy and Postgres variants on linux/amd64 only. Use terrarium_docker_hardened_images: auto or false, or set explicit image overrides, on this host architecture." |
| 156 | + when: |
| 157 | + - (terrarium_docker_hardened_images | string | lower) in ['true', 'yes', '1'] |
150 | 158 | - name: Resolve hardened image preference |
151 | 159 | ansible.builtin.set_fact: |
152 | 160 | terrarium_docker_hardened_images_effective: >- |
153 | 161 | {{ |
154 | | - (terrarium_docker_hardened_images | string | lower) in ['true', 'yes', '1'] |
155 | | - or ( |
156 | | - (terrarium_docker_hardened_images | string | lower) == 'auto' |
157 | | - and terrarium_docker_registry_config.stat.exists |
| 162 | + (terrarium_docker_hardened_image_arch_supported | bool) |
| 163 | + and ( |
| 164 | + (terrarium_docker_hardened_images | string | lower) in ['true', 'yes', '1'] |
| 165 | + or ( |
| 166 | + (terrarium_docker_hardened_images | string | lower) == 'auto' |
| 167 | + and terrarium_docker_registry_config.stat.exists |
| 168 | + ) |
158 | 169 | ) |
159 | 170 | }} |
160 | 171 | no_log: true |
161 | 172 | - name: Resolve hardened image mirror preference |
162 | 173 | ansible.builtin.set_fact: |
163 | 174 | terrarium_docker_hardened_image_mirrors_effective: >- |
164 | 175 | {{ |
165 | | - (terrarium_docker_hardened_images | string | lower) not in ['false', 'no', '0'] |
| 176 | + (terrarium_docker_hardened_image_arch_supported | bool) |
| 177 | + and (terrarium_docker_hardened_images | string | lower) not in ['false', 'no', '0'] |
166 | 178 | and (terrarium_docker_hardened_image_mirrors | string | lower) in ['true', 'yes', '1', 'auto'] |
167 | 179 | }} |
168 | 180 | no_log: true |
|
0 commit comments