mirror of
https://gitea.0xace.cc/ansible-galaxy/wireguard-ui.git
synced 2025-06-28 18:53:08 +00:00
fix deploy and bump to 0.4.0
This commit is contained in:
@ -11,10 +11,20 @@
|
||||
loop: '{{ wireguard_ui_container_registry_auth | dict2items }}'
|
||||
when: wireguard_ui_container_registry_auth is defined
|
||||
|
||||
- name: Create configuration dir for WireGuard UI
|
||||
- name: Create configuration dir and subdirs for WireGuard UI
|
||||
file:
|
||||
name: "{{ wireguard_ui_config_dir }}"
|
||||
name: "{{ item }}"
|
||||
state: directory
|
||||
loop:
|
||||
- "{{ wireguard_ui_config_dir }}"
|
||||
- "{{ wireguard_ui_config_dir }}/server"
|
||||
|
||||
- name: Force login and password change
|
||||
template:
|
||||
dest: "{{ wireguard_ui_config_dir }}/server/users.json"
|
||||
src: users.json.j2
|
||||
register: wireguard_ui_auth
|
||||
notify: Restart WireGuard UI with podman
|
||||
|
||||
- name: Create WireGuard UI with podman
|
||||
containers.podman.podman_container:
|
||||
@ -23,18 +33,13 @@
|
||||
network_mode: "{{ wireguard_ui_network_mode }}"
|
||||
image: "{{ wireguard_ui_container_registry }}/{{ wireguard_ui_image_name }}:{{ wireguard_ui_image_tag }}"
|
||||
state: created
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
env: "{{ wireguard_ui_combined_env }}"
|
||||
volumes: "{{ wireguard_ui_combined_volumes }}"
|
||||
volumes: "{{ wireguard_ui_volumes }}"
|
||||
register: wireguard_ui_container
|
||||
notify: Restart WireGuard UI with podman
|
||||
|
||||
- name: Force login and password change
|
||||
template:
|
||||
dest: "{{ wireguard_ui_config_dir }}/server/users.json"
|
||||
src: users.json.j2
|
||||
register: wireguard_ui_auth
|
||||
notify: Restart WireGuard UI with podman
|
||||
|
||||
- name: Generate container systemd unit
|
||||
shell: "podman generate systemd {{ wireguard_ui_container_name }}"
|
||||
register: wireguard_ui_systemd_unit
|
||||
|
@ -49,6 +49,6 @@
|
||||
|
||||
- name: Enable wg-quick systemd unit
|
||||
systemd:
|
||||
name: wg-quick@{{ wireguard_ui_env['WGUI_CONFIG_FILE_PATH'] | basename | split('.') | first }}
|
||||
name: wg-quick@{{ wireguard_ui_combined_env['WGUI_CONFIG_FILE_PATH'] | basename | split('.') | first }}
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
- name: Merge volumes
|
||||
set_fact:
|
||||
wireguard_ui_combined_volumes: "{{ wireguard_ui_volumes | default([]) + [item.key +':'+ item.value] }}"
|
||||
wireguard_ui_volumes: "{{ wireguard_ui_volumes | default([]) + [item.key +':'+ item.value] }}"
|
||||
loop: "{{ wireguard_ui_default_volumes | dict2items }}"
|
||||
|
||||
- name: Merge ENV
|
||||
|
Reference in New Issue
Block a user