summaryrefslogtreecommitdiffstats
path: root/roles/os_firewall
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-05-02 16:02:49 -0400
committerJason DeTiberus <detiber@gmail.com>2016-05-02 16:02:49 -0400
commitc7a7c48f6ffd0d3c2ed7f1cf46dedcfe8d4f3fc3 (patch)
tree3d14e2f9da936a845fa33ddcba08b64c170759e6 /roles/os_firewall
parent2b3943ce16ca421cf96008cfc7e5c86e9983a932 (diff)
parent404cf230da83f91a5dd9df1f289da2c6c1b7fee7 (diff)
downloadopenshift-c7a7c48f6ffd0d3c2ed7f1cf46dedcfe8d4f3fc3.tar.gz
openshift-c7a7c48f6ffd0d3c2ed7f1cf46dedcfe8d4f3fc3.tar.bz2
openshift-c7a7c48f6ffd0d3c2ed7f1cf46dedcfe8d4f3fc3.tar.xz
openshift-c7a7c48f6ffd0d3c2ed7f1cf46dedcfe8d4f3fc3.zip
Merge pull request #1854 from abutcher/v2-iptables-overrides
V2 iptables overrides
Diffstat (limited to 'roles/os_firewall')
-rw-r--r--roles/os_firewall/defaults/main.yml6
-rw-r--r--roles/os_firewall/tasks/firewall/firewalld.yml12
-rw-r--r--roles/os_firewall/tasks/firewall/iptables.yml18
3 files changed, 35 insertions, 1 deletions
diff --git a/roles/os_firewall/defaults/main.yml b/roles/os_firewall/defaults/main.yml
index 20413d563..c870a301a 100644
--- a/roles/os_firewall/defaults/main.yml
+++ b/roles/os_firewall/defaults/main.yml
@@ -1,5 +1,9 @@
---
os_firewall_enabled: True
-os_firewall_use_firewalld: True
+# TODO: Upstream kubernetes only supports iptables currently
+# TODO: it might be possible to still use firewalld if we wire up the created
+# chains with the public zone (or the zone associated with the correct
+# interfaces)
+os_firewall_use_firewalld: False
os_firewall_allow: []
os_firewall_deny: []
diff --git a/roles/os_firewall/tasks/firewall/firewalld.yml b/roles/os_firewall/tasks/firewall/firewalld.yml
index 241fa8823..5ddca1fc0 100644
--- a/roles/os_firewall/tasks/firewall/firewalld.yml
+++ b/roles/os_firewall/tasks/firewall/firewalld.yml
@@ -24,6 +24,18 @@
command: systemctl daemon-reload
when: install_result | changed
+- name: Determine if firewalld service masked
+ command: >
+ systemctl is-enabled firewalld
+ register: os_firewall_firewalld_masked_output
+ changed_when: false
+ failed_when: false
+
+- name: Unmask firewalld service
+ command: >
+ systemctl unmask firewalld
+ when: os_firewall_firewalld_masked_output.stdout == "masked"
+
- name: Start and enable firewalld service
service:
name: firewalld
diff --git a/roles/os_firewall/tasks/firewall/iptables.yml b/roles/os_firewall/tasks/firewall/iptables.yml
index 070fe6a3a..774916798 100644
--- a/roles/os_firewall/tasks/firewall/iptables.yml
+++ b/roles/os_firewall/tasks/firewall/iptables.yml
@@ -32,6 +32,24 @@
command: systemctl daemon-reload
when: install_result | changed
+- name: Determine if iptables service masked
+ command: >
+ systemctl is-enabled {{ item }}
+ with_items:
+ - iptables
+ - ip6tables
+ register: os_firewall_iptables_masked_output
+ changed_when: false
+ failed_when: false
+
+- name: Unmask iptables service
+ command: >
+ systemctl unmask {{ item }}
+ with_items:
+ - iptables
+ - ip6tables
+ when: "'masked' in os_firewall_iptables_masked_output.results | map(attribute='stdout')"
+
- name: Start and enable iptables service
service:
name: iptables