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.

1234567891011121314151617181920212223242526272829
  1. {% set ind_increment = 4 %}
  2. {%- macro vhost_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. {{ vhost_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) }}{{ vhost_config(v,'', 0, '', '')}}{{ delim }}
  12. {%- else %}
  13. {{ k|indent(ind, True) }} {{ '{' }}
  14. {{- vhost_config(v, '', ind + ind_increment) }}
  15. {{ '}'|indent(ind, True) }}
  16. {%- endif -%}
  17. {%- endfor -%}
  18. {%- elif value is iterable -%}
  19. {{ vhost_config(value, ind + ind_increment, delim, operator) }}
  20. {%- endif -%}
  21. {%- endfor -%}
  22. {%- endmacro -%}
  23. # Nginx vhost configuration
  24. #
  25. # **** DO NOT EDIT THIS FILE ****
  26. #
  27. # This file is managed by Salt.
  28. {{ vhost_config(config) }}