[EVO] Permettre de ne pas redémarrer les services
This commit is contained in:
parent
1e5564ef62
commit
cf3740d379
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
wireguard_module_host: ""
|
wireguard_module_host: ""
|
||||||
wireguard_listen_port: ""
|
wireguard_listen_port: ""
|
||||||
|
wireguard_restart_services: true
|
||||||
|
|
||||||
wireguard_interfaces: []
|
wireguard_interfaces: []
|
||||||
# Exemple:
|
# Exemple:
|
||||||
|
24
handlers/main.yml
Normal file
24
handlers/main.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
# handlers file for wireguard
|
||||||
|
|
||||||
|
- name: Activer les services
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
state: restarted
|
||||||
|
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,14 +16,27 @@
|
|||||||
interface: wg{{ index }}
|
interface: wg{{ index }}
|
||||||
become: true
|
become: true
|
||||||
register: deploy
|
register: deploy
|
||||||
|
notify:
|
||||||
|
- Activer les services
|
||||||
|
- Redémarrer les services
|
||||||
|
|
||||||
- name: Activer et redémarrer les services
|
#- name: Activer 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