Disabled automatic sorting of mapping keys in jinja templating

This commit is contained in:
francesco.a 2017-03-23 18:54:16 +01:00
parent c6f230f43a
commit 630a522ba4
3 changed files with 3 additions and 3 deletions

View File

@ -19,4 +19,4 @@ nginx_config:
- source: salt://nginx/ng/files/nginx.conf - source: salt://nginx/ng/files/nginx.conf
- template: jinja - template: jinja
- context: - context:
config: {{ nginx.server.config|json() }} config: {{ nginx.server.config|json(sort_keys=False) }}

View File

@ -1,6 +1,6 @@
{% macro sls_block(dict) %} {% macro sls_block(dict) %}
{% for key, value in dict.items() %} {% for key, value in dict.items() %}
- {{ key }}: {{ value|json() }} - {{ key }}: {{ value|json(sort_keys=False) }}
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@ -93,7 +93,7 @@ nginx_server_available_dir:
- source: salt://nginx/ng/files/server.conf - source: salt://nginx/ng/files/server.conf
- template: jinja - template: jinja
- context: - context:
config: {{ settings.config|json() }} config: {{ settings.config|json(sort_keys=False) }}
{% if 'overwrite' in settings and settings.overwrite == False %} {% if 'overwrite' in settings and settings.overwrite == False %}
- unless: - unless:
- test -e {{ server_curpath(server) }} - test -e {{ server_curpath(server) }}