From 630a522ba4af40b0ddf0f089373222b56c778745 Mon Sep 17 00:00:00 2001 From: "francesco.a" Date: Thu, 23 Mar 2017 18:54:16 +0100 Subject: [PATCH] Disabled automatic sorting of mapping keys in jinja templating --- nginx/ng/config.sls | 2 +- nginx/ng/map.jinja | 2 +- nginx/ng/servers_config.sls | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nginx/ng/config.sls b/nginx/ng/config.sls index 4d2ed1d..71dec31 100644 --- a/nginx/ng/config.sls +++ b/nginx/ng/config.sls @@ -19,4 +19,4 @@ nginx_config: - source: salt://nginx/ng/files/nginx.conf - template: jinja - context: - config: {{ nginx.server.config|json() }} + config: {{ nginx.server.config|json(sort_keys=False) }} diff --git a/nginx/ng/map.jinja b/nginx/ng/map.jinja index 8bf0e3e..0b197bc 100644 --- a/nginx/ng/map.jinja +++ b/nginx/ng/map.jinja @@ -1,6 +1,6 @@ {% macro sls_block(dict) %} {% for key, value in dict.items() %} - - {{ key }}: {{ value|json() }} + - {{ key }}: {{ value|json(sort_keys=False) }} {% endfor %} {% endmacro %} diff --git a/nginx/ng/servers_config.sls b/nginx/ng/servers_config.sls index 75cf529..e2e2685 100644 --- a/nginx/ng/servers_config.sls +++ b/nginx/ng/servers_config.sls @@ -93,7 +93,7 @@ nginx_server_available_dir: - source: salt://nginx/ng/files/server.conf - template: jinja - context: - config: {{ settings.config|json() }} + config: {{ settings.config|json(sort_keys=False) }} {% if 'overwrite' in settings and settings.overwrite == False %} - unless: - test -e {{ server_curpath(server) }}