fix wireguard-ui

This commit is contained in:
ace 2022-07-13 15:20:18 +03:00
parent 871667ef0c
commit ba2e09f3aa
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0
4 changed files with 15 additions and 7 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.galaxy_install_info

View File

@ -9,10 +9,12 @@ wireguard_ui_systemd_unit_name: "{{ wireguard_ui_container_name }}.service"
wireguard_ui_watcher_systemd_service_unit_name: "{{ wireguard_ui_container_name }}-watcher.service"
wireguard_ui_watcher_systemd_path_unit_name: "{{ wireguard_ui_container_name }}-watcher.path"
#wireguard_ui_volumes: {}
wireguard_ui_default_volumes:
- "/etc/wireguard:/etc/wireguard:Z"
- "{{ wireguard_ui_config_dir }}:/app/db:Z"
'/etc/wireguard': /etc/wireguard:Z
'{{ wireguard_ui_config_dir }}': /app/db:Z
#wireguard_ui_env: {}
wireguard_ui_default_env:
WGUI_USERNAME: admin
WGUI_PASSWORD: admin

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_combined_env }}"
volumes: "{{ wireguard_ui_combined_volumes }}"
env: "{{ wireguard_ui_env }}"
volumes: "{{ wireguard_ui_volumes }}"
register: wireguard_ui_container
- name: Generate container systemd unit

View File

@ -12,9 +12,14 @@
- "vars"
tags: wireguard_ui_vars
- set_fact:
wireguard_ui_combined_env: "{{ wireguard_ui_default_env | combine(wireguard_ui_env, recursive=true) }}"
wireguard_ui_combined_volumes: "{{ wireguard_ui_default_volumes | combine(wireguard_ui_volumes, recursive=true) }}"
- name: Merge volumes
set_fact:
wireguard_ui_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_env | default({}) | combine(wireguard_ui_default_env, recursive=true) }}"
- name: "Install WireGuard UI for {{ ansible_facts['os_family'] }}"
include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml"