]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Manage the firewall on RHEL/CentOS 6/7 76/head
authorZack Cerza <zack@redhat.com>
Wed, 15 Jul 2015 16:31:44 +0000 (10:31 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 15 Jul 2015 16:31:44 +0000 (10:31 -0600)
On EL7, poke holes for http and https. On EL6, just stop iptables.

Signed-off-by: Zack Cerza <zack@redhat.com>
roles/cobbler/tasks/redhat/rhel_6.yml [new file with mode: 0644]
roles/cobbler/tasks/redhat/rhel_7.yml [new file with mode: 0644]
roles/cobbler/tasks/setup-redhat.yml [new file with mode: 0644]
roles/cobbler/tasks/yum_systems.yml

diff --git a/roles/cobbler/tasks/redhat/rhel_6.yml b/roles/cobbler/tasks/redhat/rhel_6.yml
new file mode 100644 (file)
index 0000000..a1820bd
--- /dev/null
@@ -0,0 +1,5 @@
+---
+- name: Stop iptables
+  service:
+    name: iptables
+    state: stopped
diff --git a/roles/cobbler/tasks/redhat/rhel_7.yml b/roles/cobbler/tasks/redhat/rhel_7.yml
new file mode 100644 (file)
index 0000000..4552fe8
--- /dev/null
@@ -0,0 +1,11 @@
+---
+- name: Enable http and https using firewalld
+  firewalld:
+    service: "{{ item }}"
+    state: enabled
+    permanent: yes
+  with_items:
+    - http
+    - https
+  tags:
+    - firewall
diff --git a/roles/cobbler/tasks/setup-redhat.yml b/roles/cobbler/tasks/setup-redhat.yml
new file mode 100644 (file)
index 0000000..667e4cd
--- /dev/null
@@ -0,0 +1,8 @@
+---
+- name: Include rhel 7.x specific tasks.
+  include: redhat/rhel_7.yml
+  when: ansible_distribution_major_version == "7"
+
+- name: Include rhel 6.x specific tasks.
+  include: redhat/rhel_6.yml
+  when: ansible_distribution_major_version == "6"
index 56c9473d3efb521c71074dd950f06402f0f62308..305d0e01440190a3019ed3be2242d34eace4be60 100644 (file)
@@ -11,3 +11,7 @@
     state: latest
   with_items: cobbler_extra_packages
   when: cobbler_extra_packages|length > 0
+
+# configure red hat specific things
+- include: setup-redhat.yml
+  when: ansible_distribution in ('RedHat', 'CentOS')