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

пре 5 година
пре 5 година
пре 5 година
пре 5 година
1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {#- Get the `tplroot` from `tpldir` #}
  4. {%- set tplroot = tpldir.split('/')[0] %}
  5. {%- set sls_package_install = tplroot ~ '.package.install' %}
  6. {%- set sls_enable_service = tplroot ~ '.service.enable' %}
  7. {%- set sls_reload_service = tplroot ~ '.service.reload' %}
  8. {%- from tplroot ~ "/map.jinja" import ufw with context %}
  9. include:
  10. - {{ sls_package_install }}
  11. - {{ sls_enable_service }}
  12. - {{ sls_reload_service }}
  13. # Interfaces
  14. {%- for interface_name, interface_details in ufw.get('interfaces', {}).items() %}
  15. {%- set comment = interface_details.get('comment', None) %}
  16. ufw-interface-{{ interface_name }}:
  17. ufw.allowed:
  18. - interface: {{ interface_name }}
  19. {%- if comment is not none %}
  20. - comment: '"{{ comment }}"'
  21. {%- endif %}
  22. - listen_in:
  23. - cmd: reload-ufw
  24. {%- endfor %}