Make config backup configurable by using nft_backup_conf variable.

This commit is contained in:
Philipp Rintz 2021-03-12 09:28:45 +01:00
parent db3fbdc9b4
commit ab5c105419
No known key found for this signature in database
GPG Key ID: BE0205E9A286FF24
2 changed files with 20 additions and 7 deletions

View File

@ -529,5 +529,17 @@ nft__fail2ban_service: False
# More verbose output. # More verbose output.
nft_debug: False nft_debug: False
# .. envvar:: nft_backup_conf [[[
#
# If the nftables config files should be backuped when changed?
# Possible optionsare:
#
# ``True``
# Default. Backup all nftables config files inside the nftables directory.
#
# ``False``
# Configs will not be backuped.
nft_backup_conf: True
# ]]]
# ]]] # ]]]
# ]]] # ]]]

View File

@ -81,7 +81,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: nft_enabled|bool when: nft_enabled|bool
@ -92,7 +92,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: nft_enabled|bool when: nft_enabled|bool
@ -103,7 +103,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: nft_enabled|bool when: nft_enabled|bool
@ -115,7 +115,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: nft_enabled|bool when: nft_enabled|bool
@ -126,7 +126,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: nft_enabled|bool when: nft_enabled|bool
@ -138,7 +138,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: (nft_enabled|bool and when: (nft_enabled|bool and
nft__nat_table_manage|bool) nft__nat_table_manage|bool)
@ -150,7 +150,7 @@
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
backup: yes backup: "{{ nft_backup_conf }}"
notify: ['Reload nftables service'] notify: ['Reload nftables service']
when: (nft_enabled|bool and when: (nft_enabled|bool and
nft__nat_table_manage|bool) nft__nat_table_manage|bool)
@ -167,3 +167,4 @@
when: (nft_enabled|bool and when: (nft_enabled|bool and
nft_service_manage|bool) nft_service_manage|bool)
notify: ['Restart nftables service'] notify: ['Restart nftables service']