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

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