From 3ac177e04bdfa06f89ed092454bed83d082034ea Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Tue, 12 Nov 2024 20:46:13 +0100 Subject: [PATCH] fix(element): container image task arguments --- roles/element/defaults/main/container.yml | 5 ++++- roles/element/tasks/deploy-docker.yml | 4 ++-- roles/element/tasks/deploy-podman.yml | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/roles/element/defaults/main/container.yml b/roles/element/defaults/main/container.yml index 04677c1..1fe5d37 100644 --- a/roles/element/defaults/main/container.yml +++ b/roles/element/defaults/main/container.yml @@ -11,12 +11,15 @@ element_container_image_registry: "docker.io" element_container_image_namespace: "vectorim" element_container_image_name: "element-web" element_container_image_tag: ~ +element_container_image_source: pull +element_container_image_force_source: >-2 + {{ element_container_image_tag | default(false, true) | bool }} element_container_name: "element-web" element_container_restart_policy: >- {{ (element_deployment_method == 'docker') | ternary('unless-stopped', (element_deployment_method == 'podman' | - ternary('on-failure', 'always')) + ternary('on-failure', 'always'))) }} element_container_full_volumes: >- {{ element_container_default_volumes diff --git a/roles/element/tasks/deploy-docker.yml b/roles/element/tasks/deploy-docker.yml index bfc8cd1..79ffd05 100644 --- a/roles/element/tasks/deploy-docker.yml +++ b/roles/element/tasks/deploy-docker.yml @@ -14,8 +14,8 @@ community.docker.docker_image: name: "{{ element_container_image }}" state: "{{ element_state }}" - source: "{{ element_container_source }}" - force_source: "{{ element_container_image_tag | default(false, true) }}" + source: "{{ element_container_image_source }}" + force_source: "{{ element_container_image_force_source }}" - name: Ensure container '{{ element_container_name }}' is {{ element_state }} community.docker.docker_container: diff --git a/roles/element/tasks/deploy-podman.yml b/roles/element/tasks/deploy-podman.yml index aa49b3f..07c9c48 100644 --- a/roles/element/tasks/deploy-podman.yml +++ b/roles/element/tasks/deploy-podman.yml @@ -3,8 +3,8 @@ containers.podman.podman_image: name: "{{ element_container_image }}" state: "{{ element_state }}" - pull: "{{ element_container_source == 'pull' }}" - force: "{{ element_container_image_tag | default(false, true) }}" + pull: "{{ element_container_image_source == 'pull' }}" + force: "{{ element_container_image_force_source }}" - name: Ensure container '{{ element_container_name }}' is {{ element_state }} containers.podman.podman_container: