Browse Source

Merge pull request #1347 from detiber/fixFirewall

Fix enabling iptables for latest rhel versions
Brenton Leanhardt 9 years ago
parent
commit
b0d1a9f87b
1 changed files with 16 additions and 16 deletions
  1. 16 16
      roles/os_firewall/tasks/firewall/iptables.yml

+ 16 - 16
roles/os_firewall/tasks/firewall/iptables.yml

@@ -1,12 +1,4 @@
 ---
-- name: Install iptables packages
-  action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
-  with_items:
-  - iptables
-  - iptables-services
-  register: install_result
-  when: not openshift.common.is_atomic | bool
-
 - name: Check if firewalld is installed
   command: rpm -q firewalld
   register: pkg_check
@@ -20,6 +12,22 @@
     enabled: no
   when: pkg_check.rc == 0
 
+# TODO: submit PR upstream to add mask/unmask to service module
+- name: Mask firewalld service
+  command: systemctl mask firewalld
+  register: result
+  changed_when: "'firewalld' in result.stdout"
+  when: pkg_check.rc == 0
+  ignore_errors: yes
+
+- name: Install iptables packages
+  action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+  with_items:
+  - iptables
+  - iptables-services
+  register: install_result
+  when: not openshift.common.is_atomic | bool
+
 - name: Reload systemd units
   command: systemctl daemon-reload
   when: install_result | changed
@@ -35,14 +43,6 @@
   pause: seconds=10
   when: result | changed
 
-# TODO: submit PR upstream to add mask/unmask to service module
-- name: Mask firewalld service
-  command: systemctl mask firewalld
-  register: result
-  changed_when: "'firewalld' in result.stdout"
-  when: pkg_check.rc == 0
-  ignore_errors: yes
-
 - name: Add iptables allow rules
   os_firewall_manage_iptables:
     name: "{{ item.service }}"