Saltstack Official IPTables Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

41 rinda
747B

  1. {% from "iptables/map.jinja" import service with context %}
  2. {%- if service.enabled %}
  3. include:
  4. - iptables.rules
  5. iptables_packages:
  6. pkg.installed:
  7. - names: {{ service.pkgs }}
  8. iptables_services:
  9. service.dead:
  10. - enable: true
  11. - name: {{ service.service }}
  12. - sig: test -e /etc/iptables/rules.v4
  13. - require:
  14. - pkg: iptables_packages
  15. {%- else %}
  16. iptables_services:
  17. service.dead:
  18. - enable: false
  19. - name: {{ service.service }}
  20. {%- for chain_name in ['INPUT', 'OUTPUT', 'FORWARD'] %}
  21. iptables_{{ chain_name }}_policy:
  22. iptables.set_policy:
  23. - chain: {{ chain_name }}
  24. - policy: ACCEPT
  25. - table: filter
  26. - require_in:
  27. - iptables: iptables_flush
  28. {%- endfor %}
  29. iptables_flush:
  30. iptables.flush
  31. {%- endif %}