1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/network/tasks/iptables.yml

57 lines
1.6 KiB
YAML
Raw Normal View History

2017-05-27 18:09:50 +00:00
- name: Disable firewalld service
service: name=firewalld
enabled=no
2017-05-27 23:10:45 +00:00
when: not is_debuntu
2017-05-27 18:09:50 +00:00
- name: Use larger hammer to disable firewalld (2 symbolic links involved)
shell: "systemctl disable firewalld.service"
2017-05-27 23:10:45 +00:00
when: not is_debuntu
2017-05-27 18:09:50 +00:00
- name: Mask firewalld service
shell: 'systemctl mask firewalld'
ignore_errors: yes
2017-05-27 23:10:45 +00:00
when: not installing and not is_debuntu
2017-05-27 18:09:50 +00:00
- name: Stop firewalld service
service: name=firewalld
state=stopped
ignore_errors: yes
2017-05-27 23:10:45 +00:00
when: not installing and not is_debuntu
2017-05-27 18:09:50 +00:00
- name: Remove iptables.service file from /etc
file: path=/etc/systemd/system/iptables.service
2017-05-27 18:09:50 +00:00
state=absent
- name: Remove iptables-xs.service file from /etc
file: path=/etc/systemd/system/iptables-xs.service
2017-05-27 18:09:50 +00:00
state=absent
- name: Install iptables service package
package: name=iptables-persistent
state=present
2017-05-27 23:10:45 +00:00
when: is_debuntu
2017-05-27 18:09:50 +00:00
tags:
- download
- name: Install iptables service package
package: name=iptables-services
state=present
2017-05-27 23:10:45 +00:00
when: not is_debuntu
2017-05-27 18:09:50 +00:00
tags:
- download
- name: Install iptables services
template: src={{ item.0 }}
dest={{ item.1 }}
owner='root'
group='root'
mode={{ item.2 }}
with_items:
2017-11-05 20:19:23 +00:00
- { 0: 'roles/network/templates/gateway/iptables-config', 1: '/etc/sysconfig/iptables-config', 2: '0644' }
- { 0: 'roles/network/templates/gateway/check-LAN', 1: '/usr/bin/check-LAN', 2: '0755' }
2017-05-27 18:09:50 +00:00
2017-10-27 17:32:06 +00:00
- name: Install Debian config
2017-11-05 20:19:23 +00:00
template: src=roles/network/templates/gateway/iptables dest=/etc/network/if-pre-up.d/iptables
2017-05-27 18:09:50 +00:00
mode=0755
2017-05-27 23:10:45 +00:00
when: is_debuntu