From e8c6ab5af3a713a8de0e23ce8f7b2adae2f74284 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 6 Nov 2020 12:58:17 +0100 Subject: [PATCH] Remove support for Ubuntu < 14.04 --- tasks/plain-iptables.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tasks/plain-iptables.yml b/tasks/plain-iptables.yml index 7aae2fe..a7bddc5 100644 --- a/tasks/plain-iptables.yml +++ b/tasks/plain-iptables.yml @@ -3,23 +3,14 @@ - name: Install the needed iptables packages apt: pkg={{ iptables_deb_pkgs }} state=present cache_valid_time=1800 - - name: Create the /etc/iptables directory when needed - file: dest=/etc/iptables state=directory owner=root group=root mode=0755 - when: is_ubuntu_between_10_04_and_11_04_and_is_debian_6 - - - name: Install the IPv4 rules with a different name. Needed by Ubuntu < 12.04 - template: src=iptables-{{ item }}.j2 dest=/etc/iptables/rules owner=root group=root mode=0640 - with_items: - - rules.v4 - when: is_ubuntu_between_10_04_and_11_04_and_is_debian_6 - notify: Start the iptables service on Ubuntu < 12.04 - - name: Install the IPv4 and IPv6 iptables rules. The IPv6 ones are not used. On trusty template: src=iptables-{{ item }}.j2 dest=/etc/iptables/{{ item }} owner=root group=root mode=0640 with_items: - rules.v4 - rules.v6 - when: is_trusty + when: + - ansible_distribution == 'Ubuntu' + - ansible_distribution_version is version_compare('14.04', '==') register: install_iptables_rules_trusty - name: Install the IPv4 and IPv6 iptables rules. The IPv6 ones are not used. On debian 7 @@ -105,3 +96,4 @@ - restart_related_x is changed tags: [ 'iptables', 'iptables_rules' ] +