Notify `nftables` service when configuration file is modified.
This commit is contained in:
parent
bc6f69fc59
commit
1c1013067d
|
@ -19,6 +19,8 @@ A role to manage Nftables rules and packages.
|
|||
* **nft_pkg_state** : State of new `nftables` package(s) [default : `installed`].
|
||||
* **nft_main_conf_path** : Main configuration file loaded by systemd unit [default : `/etc/nftables.conf`].
|
||||
* **nft_main_conf_content** : Template used to generate the previous main configuration file [default : `etc/nftables.conf.j2`].
|
||||
* **nft_service_manage** : If `nftables` service should be managed with this role [default : `true`].
|
||||
* **nft_service_name** : `nftables` service name [default : `nftables`].
|
||||
|
||||
### OS Specific Variables
|
||||
|
||||
|
@ -41,6 +43,7 @@ Please see default value by Operating System file in [vars][vars directory] dire
|
|||
This role will :
|
||||
* Install `nftables` on the system.
|
||||
* Generate a default configuration file loaded by systemd unit.
|
||||
* Restart `nftables` service.
|
||||
|
||||
## Development
|
||||
|
||||
|
|
|
@ -8,3 +8,7 @@ nft_pkg_state: 'installed'
|
|||
# conf
|
||||
nft_main_conf_path: '/etc/nftables.conf'
|
||||
nft_main_conf_content: 'etc/nftables.conf.j2'
|
||||
|
||||
# service
|
||||
nft_service_manage: true
|
||||
nft_service_name: 'nftables'
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
# handlers file for nftables
|
||||
- name: restart nftables service
|
||||
service: name={{ nft_service_name }} state=restarted
|
||||
when: nft_service_manage
|
|
@ -28,5 +28,5 @@
|
|||
group: root
|
||||
mode: 0755
|
||||
backup: yes
|
||||
|
||||
notify: restart nftables service
|
||||
# }}}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
localhost
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- nftables
|
Loading…
Reference in New Issue