Saltstack Official FirewallD Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

54 lines
1.2KB

  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.ipsets
  10. - firewalld.services
  11. - firewalld.zones
  12. # iptables service that comes with rhel/centos
  13. iptables:
  14. service.disabled:
  15. - enable: False
  16. ip6tables:
  17. service.disabled:
  18. - enable: False
  19. package_firewalld:
  20. pkg.installed:
  21. - name: {{ firewalld.package }}
  22. service_firewalld_running:
  23. service.running:
  24. - name: {{ firewalld.service }}
  25. - enable: True # start on boot
  26. - require:
  27. - pkg: package_firewalld
  28. - file: config_firewalld
  29. - service: iptables # ensure it's stopped
  30. - service: ip6tables # ensure it's stopped
  31. service_firewalld:
  32. module.wait:
  33. - name: service.restart
  34. - m_name: {{ firewalld.service }}
  35. - require:
  36. - pkg: package_firewalld
  37. - file: config_firewalld
  38. - service: iptables # ensure it's stopped
  39. - service: ip6tables # ensure it's stopped
  40. {% else %}
  41. service_firewalld_dead:
  42. service.dead:
  43. - name: {{ firewalld.service }}
  44. - enable: False # don't start on boot
  45. {% endif %}