From d657e1a7ee17945a0b82a9c5c649f28f89011103 Mon Sep 17 00:00:00 2001 From: ace Date: Fri, 15 Jul 2022 18:14:47 +0300 Subject: [PATCH] use separate naming for combined vars --- handlers/main.yaml | 8 ++++---- tasks/RedHat/podman.yaml | 4 ++-- tasks/main.yaml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/handlers/main.yaml b/handlers/main.yaml index e022714..9c34d78 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -7,8 +7,8 @@ container_default_behavior: no_defaults detach: true restart_policy: unless-stopped - env: "{{ wireguard_ui_env }}" - volumes: "{{ wireguard_ui_volumes }}" + env: "{{ wireguard_ui_combined_env }}" + volumes: "{{ wireguard_ui_combined_volumes }}" when: - wireguard_ui_container_engine == 'docker' - not wireguard_ui_container.changed @@ -22,8 +22,8 @@ image: "{{ wireguard_ui_container_registry }}/{{ wireguard_ui_image_name }}:{{ wireguard_ui_image_tag }}" state: started restart: yes - env: "{{ wireguard_ui_env }}" - volumes: "{{ wireguard_ui_volumes }}" + env: "{{ wireguard_ui_combined_env }}" + volumes: "{{ wireguard_ui_combined_volumes }}" when: - wireguard_ui_container_engine == 'podman' - not wireguard_ui_container.changed diff --git a/tasks/RedHat/podman.yaml b/tasks/RedHat/podman.yaml index 7f6e5d5..63758cc 100644 --- a/tasks/RedHat/podman.yaml +++ b/tasks/RedHat/podman.yaml @@ -23,8 +23,8 @@ network_mode: "{{ wireguard_ui_network_mode }}" image: "{{ wireguard_ui_container_registry }}/{{ wireguard_ui_image_name }}:{{ wireguard_ui_image_tag }}" state: created - env: "{{ wireguard_ui_env }}" - volumes: "{{ wireguard_ui_volumes }}" + env: "{{ wireguard_ui_combined_env }}" + volumes: "{{ wireguard_ui_combined_volumes }}" register: wireguard_ui_container notify: Restart WireGuard UI with podman diff --git a/tasks/main.yaml b/tasks/main.yaml index 214df5f..f4c72f9 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -14,12 +14,12 @@ - name: Merge volumes set_fact: - wireguard_ui_volumes: "{{ wireguard_ui_volumes | default([]) + [item.key +':'+ item.value] }}" + wireguard_ui_combined_volumes: "{{ wireguard_ui_volumes | default([]) + [item.key +':'+ item.value] }}" loop: "{{ wireguard_ui_default_volumes | dict2items }}" - name: Merge ENV set_fact: - wireguard_ui_env: "{{ wireguard_ui_default_env | combine(wireguard_ui_env | default({}), recursive=true) }}" + wireguard_ui_combined_env: "{{ wireguard_ui_default_env | combine(wireguard_ui_env | default({}), recursive=true) }}" - name: "Install WireGuard UI for {{ ansible_facts['os_family'] }}" include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml"