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

30 satır
933B

  1. {% set indent_increment = 4 %}
  2. {%- macro nginx_block(value, key=None, operator=' ', delim=';', ind=0) -%}
  3. {%- if value is number or value is string -%}
  4. {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
  5. {%- elif value is mapping -%}
  6. {{ key|indent(ind, True) }}{{ operator }}{{ '{' }}
  7. {%- for k, v in value.items() %}
  8. {{ nginx_block(v, k, operator, delim, (ind + indent_increment)) }}
  9. {%- endfor %}
  10. {{ '}'|indent(ind, True) }}
  11. {%- elif value is iterable -%}
  12. {%- for v in value %}
  13. {{ nginx_block(v, key, operator, delim, ind) }}
  14. {%- endfor -%}
  15. {%- else -%}
  16. {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
  17. {%- endif -%}
  18. {%- endmacro -%}
  19. # Default nginx server configuration
  20. #
  21. # **** DO NOT EDIT THIS FILE ****
  22. #
  23. # This file is managed by Salt.
  24. {% for key, value in config.items() %}
  25. {{ nginx_block(value, key) }}
  26. {%- endfor -%}