fix wireguard systemd start

This commit is contained in:
ace 2022-07-13 16:00:25 +03:00
parent 3084a0e59c
commit fb0ac44188
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0
2 changed files with 25 additions and 1 deletions

View File

@ -10,3 +10,9 @@
name: name:
- kmod-wireguard - kmod-wireguard
- wireguard-tools - wireguard-tools
- name: Enable wg-quick systemd unit
systemd:
name: wg-quick@{{ wireguard_ui_env['WGUI_CONFIG_FILE_PATH'] | basename | split('.') | first }}
enabled: yes
daemon_reload: yes

View File

@ -25,7 +25,7 @@
include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml" include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml"
tags: wireguard_ui_install tags: wireguard_ui_install
- name: Enable and start WireGuard UI services - name: Enable and start WireGuard UI
systemd: systemd:
daemon_reload: true daemon_reload: true
name: "{{ item }}" name: "{{ item }}"
@ -34,8 +34,26 @@
masked: no masked: no
loop: loop:
- "{{ wireguard_ui_systemd_unit_name }}" - "{{ wireguard_ui_systemd_unit_name }}"
- name: Enable WireGuard UI watcher services
systemd:
daemon_reload: true
name: "{{ item }}"
enabled: true
masked: no
loop:
- "{{ wireguard_ui_watcher_systemd_service_unit_name }}" - "{{ wireguard_ui_watcher_systemd_service_unit_name }}"
- "{{ wireguard_ui_watcher_systemd_path_unit_name }}" - "{{ wireguard_ui_watcher_systemd_path_unit_name }}"
- name: Enable WireGuard UI path watcher service
systemd:
daemon_reload: true
name: "{{ item }}"
enabled: true
state: started
masked: no
loop:
- "{{ wireguard_ui_watcher_systemd_path_unit_name }}"
tags: wireguard_ui_start tags: wireguard_ui_start