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.

31 lines
647B

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {#- Get the `tplroot` from `tpldir` #}
  4. {%- set tplroot = tpldir.split('/')[0] %}
  5. {%- set sls_config_file = tplroot ~ '.config.file' %}
  6. {%- from tplroot ~ "/map.jinja" import ufw with context %}
  7. include:
  8. - {{ sls_config_file }}
  9. {%- if ufw.get('enabled', False) %}
  10. ufw-service-running-service-running:
  11. service.running:
  12. - name: {{ ufw.service.name }}
  13. - enable: true
  14. - require:
  15. - sls: {{ sls_config_file }}
  16. {%- else %}
  17. ufw-service-dead-service-dead:
  18. service.dead:
  19. - name: {{ ufw.service.name }}
  20. - enable: false
  21. - require:
  22. - sls: {{ sls_config_file }}
  23. {%- endif %}