Compare commits
No commits in common. "f7aa5380e0b3c7873f7e92bf0c85a30d5a65016e" and "1e5564ef6241aa116153bbdb2b617a21d211bb2d" have entirely different histories.
f7aa5380e0
...
1e5564ef62
@ -10,12 +10,6 @@ Variable permettant de déployer le module (dkms) de wireguard sur l'hôte qui h
|
|||||||
|
|
||||||
*<span style="text-decoration: underline">Valeur par défaut:</span> aucune*
|
*<span style="text-decoration: underline">Valeur par défaut:</span> aucune*
|
||||||
|
|
||||||
### wireguard_restart_services
|
|
||||||
|
|
||||||
Redémarrer les services si la configuration a été modifiée.
|
|
||||||
|
|
||||||
*<span style="text-decoration: underline">Valeur par défaut:</span> `true`*
|
|
||||||
|
|
||||||
### wireguard_interfaces
|
### wireguard_interfaces
|
||||||
|
|
||||||
Configuration des interfaces de wireguard (`/etc/wireguard/wgX.conf`).
|
Configuration des interfaces de wireguard (`/etc/wireguard/wgX.conf`).
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# defaults file for wireguard
|
# defaults file for wireguard
|
||||||
|
|
||||||
wireguard_module_host: ""
|
wireguard_module_host: ""
|
||||||
wireguard_restart_services: true
|
wireguard_listen_port: ""
|
||||||
|
|
||||||
wireguard_interfaces: []
|
wireguard_interfaces: []
|
||||||
# Exemple:
|
# Exemple:
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
# handlers file for wireguard
|
|
||||||
|
|
||||||
- name: Activer les services
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
enabled: true
|
|
||||||
name: wg-quick@wg{{ item }}.service
|
|
||||||
become: true
|
|
||||||
loop: "{{ deploy.results | selectattr('changed', 'equalto', true) | map(attribute='index') }}"
|
|
||||||
loop_control:
|
|
||||||
index_var: index
|
|
||||||
label: wg{{ index }}
|
|
||||||
|
|
||||||
- name: Redémarrer les services
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
state: restarted
|
|
||||||
name: wg-quick@wg{{ item }}.service
|
|
||||||
when: wireguard_restart_services
|
|
||||||
become: true
|
|
||||||
loop: "{{ deploy.results | selectattr('changed', 'equalto', true) | map(attribute='index') }}"
|
|
||||||
loop_control:
|
|
||||||
index_var: index
|
|
||||||
label: wg{{ index }}
|
|
@ -16,27 +16,14 @@
|
|||||||
interface: wg{{ index }}
|
interface: wg{{ index }}
|
||||||
become: true
|
become: true
|
||||||
register: deploy
|
register: deploy
|
||||||
notify:
|
|
||||||
- Activer les services
|
|
||||||
- Redémarrer les services
|
|
||||||
|
|
||||||
#- name: Activer les services
|
- name: Activer et redémarrer les services
|
||||||
# ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
# state: restarted
|
state: restarted
|
||||||
# enabled: true
|
enabled: true
|
||||||
# name: wg-quick@wg{{ item }}.service
|
name: wg-quick@wg{{ item }}.service
|
||||||
# become: true
|
become: true
|
||||||
# loop: "{{ deploy.results | selectattr('changed', 'equalto', true) | map(attribute='index') }}"
|
loop: "{{ deploy.results | selectattr('changed', 'equalto', true) | map(attribute='index') }}"
|
||||||
# loop_control:
|
loop_control:
|
||||||
# index_var: index
|
index_var: index
|
||||||
# label: wg{{ index }}
|
label: wg{{ index }}
|
||||||
#
|
|
||||||
#- name: Redémarrer les services
|
|
||||||
# ansible.builtin.systemd:
|
|
||||||
# state: restarted
|
|
||||||
# name: wg-quick@wg{{ item }}.service
|
|
||||||
# become: true
|
|
||||||
# loop: "{{ deploy.results | selectattr('changed', 'equalto', true) | map(attribute='index') }}"
|
|
||||||
# loop_control:
|
|
||||||
# index_var: index
|
|
||||||
# label: wg{{ index }}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user