From 11abd588a614a574ebdb5e7fe099b920164b09f1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 29 Aug 2023 17:12:31 +0200 Subject: add dependent services to mount/network interface roles --- roles/wireguard/defaults/main.yml | 2 ++ roles/wireguard/tasks/main.yml | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'roles/wireguard') diff --git a/roles/wireguard/defaults/main.yml b/roles/wireguard/defaults/main.yml index 44120db..10af15c 100644 --- a/roles/wireguard/defaults/main.yml +++ b/roles/wireguard/defaults/main.yml @@ -5,3 +5,5 @@ wg_listen_port: 51280 #wg_addr6: #wg_peers: wg_router: false + +wg_dependent_services: [] diff --git a/roles/wireguard/tasks/main.yml b/roles/wireguard/tasks/main.yml index 5478c4f..279ffd0 100644 --- a/roles/wireguard/tasks/main.yml +++ b/roles/wireguard/tasks/main.yml @@ -27,3 +27,10 @@ enabled: true state: restarted when: config.changed + +- name: Set up service dependencies + ansible.builtin.include_role: + name: systemd_depend_iface + vars: + systemd_depend_iface_name: '{{ wg_name }}' + systemd_depend_iface_services: '{{ wg_dependent_services }}' -- cgit v1.2.3