Saltstack Official IPTables 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.

преди 9 години
преди 9 години
преди 9 години
преди 9 години
преди 9 години
преди 9 години
12345678910111213141516171819202122232425262728293031323334353637383940
  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 %}