roles/common: Bump version checks to Debian 9

This commit is contained in:
Alan Orth 2019-10-26 16:37:27 +02:00
parent 0605f70f2e
commit 9db104efa6
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -10,7 +10,7 @@
- python3-systemd # for fail2ban systemd backend - python3-systemd # for fail2ban systemd backend
- name: Install firewalld and deps - name: Install firewalld and deps
when: ansible_distribution_major_version is version_compare('8', '>=') when: ansible_distribution_major_version is version_compare('9', '>=')
apt: pkg={{ debian_firewall_packages }} state=present apt: pkg={{ debian_firewall_packages }} state=present
- name: Use nftables backend in firewalld - name: Use nftables backend in firewalld
@ -35,17 +35,17 @@
- restart firewalld - restart firewalld
- name: Copy firewalld public zone file - name: Copy firewalld public zone file
when: ansible_distribution_major_version is version_compare('8', '>=') when: ansible_distribution_major_version is version_compare('9', '>=')
template: src=public.xml.j2 dest=/etc/firewalld/zones/public.xml owner=root mode=0600 template: src=public.xml.j2 dest=/etc/firewalld/zones/public.xml owner=root mode=0600
- name: Format public.xml firewalld zone file - name: Format public.xml firewalld zone file
when: ansible_distribution_major_version is version_compare('8', '>=') when: ansible_distribution_major_version is version_compare('9', '>=')
command: tidy -xml -iq -m -w 0 /etc/firewalld/zones/public.xml command: tidy -xml -iq -m -w 0 /etc/firewalld/zones/public.xml
notify: notify:
- restart firewalld - restart firewalld
- name: Copy ipsets of abusive IPs - name: Copy ipsets of abusive IPs
when: ansible_distribution_major_version is version_compare('8', '>=') when: ansible_distribution_major_version is version_compare('9', '>=')
copy: src={{ item }} dest=/etc/firewalld/ipsets/{{ item }} owner=root group=root mode=0600 copy: src={{ item }} dest=/etc/firewalld/ipsets/{{ item }} owner=root group=root mode=0600
loop: loop:
- abusers-ipv4.xml - abusers-ipv4.xml