firewalld-formula/firewalld/init.sls

53 lines
1.2 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
- firewalld.services
- firewalld.zones
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
ip6tables:
service.disabled:
2014-08-23 16:44:48 +02:00
- enable: False
package_firewalld:
pkg.installed:
- name: {{ firewalld.package }}
service_firewalld_running:
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
service_firewalld:
module.wait:
- name: service.restart
- m_name: {{ firewalld.service }}
- require:
- pkg: package_firewalld
- file: config_firewalld
- service: iptables # ensure it's stopped
- service: ip6tables # ensure it's stopped
{% else %}
service_firewalld_dead:
service.dead:
- name: {{ firewalld.service }}
- enable: False # don't start on boot
{% endif %}