Saltstack Official Nginx Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

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