Files
toallab-automation/roles/ansible-role-redhat_satellite6_installation/tasks/firewall.yml
2018-11-20 10:36:24 -05:00

54 lines
1.1 KiB
YAML

---
- name: "Include firewall.yml"
include_vars: "vars/firewall.yml"
tags:
- "firewall"
#Install firewalld and enable it
- name: "Install firewalld"
become: "yes"
yum:
name: "firewalld"
state: "present"
ignore_errors: "yes"
tags:
- "firewall"
- name: "Set hostname with hostnamectl"
hostname:
name: "{{ satellite_deployment_hostname_full }}"
tags:
- "firewall"
- name: "Update /etc/hosts wiht satellite hostname"
lineinfile:
line: "{{ satellite_deployment_ip_address }}
{{ satellite_deployment_hostname_full }}
{{ satellite_deployment_hostname_short }}"
dest: "/etc/hosts"
tags:
- "firewall"
- name: "Enable Firewalld"
become: "yes"
service:
enabled: "yes"
name: "firewalld"
state: "started"
tags:
- "firewall"
#Opening firewall ports
- name: "Firewall and hostname | Opening Firewalld ports"
become: "yes"
firewalld:
permanent: "yes"
immediate: "yes"
port: "{{ item }}"
state: "enabled"
with_items: "{{ satellite_deployment_fw_ports +
satellite_deployment_plugin_ports }}"
ignore_errors: "yes"
tags:
- "firewall"