2017-08-07 14:14:14 +02:00
|
|
|
---
|
|
|
|
# handlers file for nftables
|
2020-04-21 09:53:57 +02:00
|
|
|
|
|
|
|
# (re)Start will be called at first run
|
2018-07-25 15:06:31 +02:00
|
|
|
- name: Restart nftables service
|
|
|
|
systemd:
|
2021-07-30 09:34:38 +02:00
|
|
|
daemon_reload: '{{ (nftables__register_systemd_service.changed | default(False)) or
|
|
|
|
(nftables__register_fail2ban_service.changed | default(False)) }}'
|
2018-07-25 15:06:31 +02:00
|
|
|
state: 'restarted'
|
|
|
|
name: '{{ nft_service_name }}'
|
|
|
|
enabled: '{{ nft_service_enabled }}'
|
|
|
|
when: ansible_service_mgr == 'systemd' and nft_service_manage
|
2020-04-21 09:53:57 +02:00
|
|
|
|
|
|
|
# Reload will avoid to loose Nftables rulebase if an invalid syntax is added
|
|
|
|
- name: Reload nftables service
|
|
|
|
systemd:
|
|
|
|
state: 'reloaded'
|
|
|
|
name: '{{ nft_service_name }}'
|
|
|
|
when: ansible_service_mgr == 'systemd' and
|
|
|
|
nft_service_manage and
|
|
|
|
not nftables__register_systemd_service.changed
|