firewalld-formula/firewalld/init.sls

51 lines
1.0 KiB
Plaintext
Raw Normal View History

2014-08-23 16:44:48 +02:00
# == State: firewalld
#
# This state installs/runs firewalld.
#
{% from "firewalld/map.jinja" import firewalld with context %}
2014-08-23 16:44:48 +02:00
{% if salt['pillar.get']('firewalld:enabled') %}
include:
- firewalld.config
2016-09-03 21:43:40 +02:00
- firewalld.ipsets
- firewalld.services
- firewalld.zones
2016-09-13 23:25:51 +02:00
- firewalld.direct
2014-08-23 16:44:48 +02:00
# iptables service that comes with rhel/centos
iptables:
service.disabled:
2014-08-23 16:44:48 +02:00
- enable: False
2014-08-23 16:44:48 +02:00
ip6tables:
service.disabled:
2014-08-23 16:44:48 +02:00
- enable: False
package_firewalld:
pkg.installed:
- name: {{ firewalld.package }}
service_firewalld:
service.running:
- name: {{ firewalld.service }}
2014-08-23 16:44:48 +02:00
- enable: True # start on boot
- require:
- pkg: package_firewalld
- file: config_firewalld
- service: iptables # ensure it's stopped
- service: ip6tables # ensure it's stopped
reload_firewalld:
cmd.wait:
- name: 'firewall-cmd --reload'
- require:
- service: service_firewalld
{% else %}
service_firewalld:
service.dead:
- name: {{ firewalld.service }}
- enable: False # don't start on boot
{% endif %}