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.

33 satır
997B

  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. {{ nginx_block(v, k, operator, delim, (ind + indent_increment)) }}
  10. {%- endfor %}
  11. {{ '}'|indent(ind, True) }}
  12. {%- elif value is iterable -%}
  13. {%- for v in value %}
  14. {{ nginx_block(v, key, operator, delim, ind) }}
  15. {%- endfor -%}
  16. {%- else -%}
  17. {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
  18. {%- endif -%}
  19. {%- else -%}
  20. {%- endif -%}
  21. {%- endmacro -%}
  22. # Default nginx server configuration
  23. #
  24. # **** DO NOT EDIT THIS FILE ****
  25. #
  26. # This file is managed by Salt.
  27. {% for key, value in config.items() %}
  28. {{ nginx_block(value, key) }}
  29. {%- endfor -%}