Saltstack Official FirewallD Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.sls 1.2KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # == State: firewalld
  2. #
  3. # This state installs/runs firewalld.
  4. #
  5. {% from "firewalld/map.jinja" import firewalld with context %}
  6. {% if salt['pillar.get']('firewalld:enabled') %}
  7. include:
  8. - firewalld.config
  9. - firewalld.services
  10. - firewalld.zones
  11. # iptables service that comes with rhel/centos
  12. iptables:
  13. service.disabled:
  14. - enable: False
  15. ip6tables:
  16. service.disabled:
  17. - enable: False
  18. package_firewalld:
  19. pkg.installed:
  20. - name: {{ firewalld.package }}
  21. service_firewalld_running:
  22. service.running:
  23. - name: {{ firewalld.service }}
  24. - enable: True # start on boot
  25. - require:
  26. - pkg: package_firewalld
  27. - file: config_firewalld
  28. - service: iptables # ensure it's stopped
  29. - service: ip6tables # ensure it's stopped
  30. service_firewalld:
  31. module.wait:
  32. - name: service.restart
  33. - m_name: {{ firewalld.service }}
  34. - require:
  35. - pkg: package_firewalld
  36. - file: config_firewalld
  37. - service: iptables # ensure it's stopped
  38. - service: ip6tables # ensure it's stopped
  39. {% else %}
  40. service_firewalld_dead:
  41. service.dead:
  42. - name: {{ firewalld.service }}
  43. - enable: False # don't start on boot
  44. {% endif %}