roles/common: fix logic for copying AbuseIPDB.com nft sets

We have to force these because they are not updated on the host like
the other lists (API limit of five requests per day!). We update the
list periodically here in git.
This commit is contained in:
Alan Orth 2021-09-08 09:58:13 +03:00
parent 37901da5b5
commit 635bb5234d
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 12 additions and 12 deletions

View File

@ -36,13 +36,13 @@
- name: Copy extra nftables configuration files - name: Copy extra nftables configuration files
when: ansible_distribution_major_version is version('11', '>=') when: ansible_distribution_major_version is version('11', '>=')
copy: src={{ item }} dest=/etc/nftables/{{ item }} owner=root group=root mode=0644 force=no copy: src={{ item.src }} dest=/etc/nftables/{{ item.src }} owner=root group=root mode=0644 force={{ item.force }}
loop: loop:
- spamhaus-ipv4.nft - { src: "spamhaus-ipv4.nft", force: "no" }
- spamhaus-ipv6.nft - { src: "spamhaus-ipv6.nft", force: "no" }
- abusech-ipv4.nft - { src: "abusech-ipv4.nft", force: "no" }
- abuseipdb-ipv4.nft - { src: "abuseipdb-ipv4.nft", force: "yes" }
- abuseipdb-ipv6.nft - { src: "abuseipdb-ipv6.nft", force: "yes" }
notify: notify:
- restart nftables - restart nftables

View File

@ -42,13 +42,13 @@
- name: Copy extra nftables configuration files - name: Copy extra nftables configuration files
when: ansible_distribution_version is version('20.04', '>=') when: ansible_distribution_version is version('20.04', '>=')
copy: src={{ item }} dest=/etc/nftables/{{ item }} owner=root group=root mode=0644 force=no copy: src={{ item.src }} dest=/etc/nftables/{{ item.src }} owner=root group=root mode=0644 force={{ item.force }}
loop: loop:
- spamhaus-ipv4.nft - { src: "spamhaus-ipv4.nft", force: "no" }
- spamhaus-ipv6.nft - { src: "spamhaus-ipv6.nft", force: "no" }
- abusech-ipv4.nft - { src: "abusech-ipv4.nft", force: "no" }
- abuseipdb-ipv4.nft - { src: "abuseipdb-ipv4.nft", force: "yes" }
- abuseipdb-ipv6.nft - { src: "abuseipdb-ipv6.nft", force: "yes" }
notify: notify:
- restart nftables - restart nftables