refactor(barad-dur): migrate to harmonised container image variables

This commit is contained in:
Lars Kaiser 2023-04-19 16:40:14 +02:00
parent 9dbd99a305
commit fdcb1c23ff
No known key found for this signature in database
GPG key ID: BB97304A16BC5DCF
2 changed files with 25 additions and 4 deletions

View file

@ -3,11 +3,32 @@ barad_dur_user: barad-dur
barad_dur_base_path: /opt/barad-dur
barad_dur_container_base_path: "{{ barad_dur_base_path }}"
barad_dur_config_file: "{{ barad_dur_base_path }}/config.yaml"
barad_dur_version: "0.1.0"
barad_dur_container_image_registry: "registry.gitlab.com"
barad_dur_container_image_namespace: "famedly/company/backend/services/"
barad_dur_container_image_name: "barad-dur"
barad_dur_version: "0.1.2"
#barad_dur_container_image_tag: ~
barad_dur_container_force_pull: "{{ barad_dur_container_image_tag is defined }}"
barad_dur_container_image_reference: >-
{{
barad_dur_container_image_repository
+ ':'
+ barad_dur_container_image_tag | default('v' + barad_dur_version)
}}
barad_dur_container_image_repository: >-
{{
(
container_registries[barad_dur_container_image_registry]
| default(barad_dur_container_image_registry)
)
+ '/'
+ barad_dur_container_image_namespace | default('')
+ barad_dur_container_image_name
}}
barad_dur_container_name: "barad-dur"
barad_dur_container_image_name: "registry.gitlab.com/famedly/infra/services/barad-dur"
barad_dur_container_image: "{{ barad_dur_container_image_name }}:{{ barad_dur_container_image_tag|default(['v', barad_dur_version]|join()) }}"
barad_dur_container_env: {}
barad_dur_container_ports: []
barad_dur_container_labels: {}

View file

@ -27,7 +27,7 @@
- name: Start barad-dur container
docker_container:
name: "{{ barad_dur_container_name }}"
image: "{{ barad_dur_container_image }}"
image: "{{ barad_dur_container_image_reference }}"
env: "{{ barad_dur_container_env }}"
user: "{{ barad_dur_user_res.uid }}:{{ barad_dur_user_res.group }}"
ports: "{{ barad_dur_container_ports }}"