First commit for Spacewalk Ansible roles

This commit is contained in:
Fayaaz Ahmed
2016-04-15 15:25:47 +01:00
commit bef92a6564
32 changed files with 2021 additions and 0 deletions

21
roles/iptables/tasks/main.yml Executable file
View File

@ -0,0 +1,21 @@
---
- name: Ensure iptables is installed (RedHat).
yum: pkg=iptables state=installed
when: ansible_os_family == 'RedHat'
- name: Ensure iptables is installed (Debian).
apt: pkg=iptables state=installed
when: ansible_os_family == 'Debian'
- name: Flush iptables the first time playbook runs.
command: iptables -F creates=/etc/init.d/firewall
- name: Copy firewall script into place.
template: src=firewall.bash.j2 dest=/etc/firewall.bash owner=root group=root mode=0744
notify: restart firewall
- name: Copy firewall init script into place.
template: src=firewall.j2 dest=/etc/init.d/firewall owner=root group=root mode=0755
- name: Ensure the firewall is enabled and will start on boot.
service: name=firewall state=started enabled=yes