use separate naming for combined vars

This commit is contained in:
ace 2022-07-15 18:14:47 +03:00
parent 77461f5d51
commit d657e1a7ee
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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"