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

64 lines
1.6 KiB
YAML
Raw Normal View History

- name: Disable firewalld service (OS's other than debuntu)
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
2018-10-31 01:38:52 +00:00
# Likely no longer nec as of 2019
- name: Use larger hammer -- systemctl disable firewalld -- 2 symbolic links involved (OS's other than debuntu)
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 (OS's other than debuntu)
2018-10-31 01:38:52 +00:00
shell: systemctl mask firewalld
2017-05-27 18:09:50 +00:00
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 (OS's other than debuntu)
service:
name: firewalld
state: stopped
2017-05-27 18:09:50 +00:00
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
2018-10-31 01:38:52 +00:00
- name: Remove /etc/systemd/system/iptables.service
file:
path: /etc/systemd/system/iptables.service
state: absent
2017-05-27 18:09:50 +00:00
2018-10-31 01:38:52 +00:00
#- name: Remove iptables-xs.service file from /etc
# file:
# path: /etc/systemd/system/iptables-xs.service
# state: absent
2017-05-27 18:09:50 +00:00
2018-10-31 01:38:52 +00:00
- name: Install package iptables-persistent (debuntu)
package:
name: iptables-persistent
state: present
when: is_debuntu | bool
2017-05-27 18:09:50 +00:00
tags:
- download
2018-10-31 01:38:52 +00:00
- name: Install package iptables-services (OS's other than debuntu)
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
2018-10-31 01:38:52 +00:00
- name: Install /etc/sysconfig/iptables-config from template
template:
2018-10-31 01:38:52 +00:00
src: iptables-config
2018-10-31 01:50:07 +00:00
dest: /etc/sysconfig/iptables-config
owner: root
group: root
2018-10-31 01:38:52 +00:00
mode: 0644
2017-05-27 18:09:50 +00:00
2018-10-31 01:38:52 +00:00
- name: Install /etc/network/if-pre-up.d/iptables from template (debuntu)
template:
src: iptables
2018-10-31 01:50:07 +00:00
dest: /etc/network/if-pre-up.d/iptables
mode: 0755
when: is_debuntu | bool