diff --git a/tasks/RedHat/wireguard_install.yaml b/tasks/RedHat/wireguard_install.yaml index 509188d..0e27440 100644 --- a/tasks/RedHat/wireguard_install.yaml +++ b/tasks/RedHat/wireguard_install.yaml @@ -10,3 +10,9 @@ name: - kmod-wireguard - 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 diff --git a/tasks/main.yaml b/tasks/main.yaml index 50d20a8..6cef733 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -25,7 +25,7 @@ include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml" tags: wireguard_ui_install -- name: Enable and start WireGuard UI services +- name: Enable and start WireGuard UI systemd: daemon_reload: true name: "{{ item }}" @@ -34,8 +34,26 @@ masked: no loop: - "{{ 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_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