From 182098fc16c01313ebf2c36ca605bfb1f18585cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Mon, 20 Jun 2016 22:24:20 +0200 Subject: [PATCH] JSON encode values embedded in the salt-master's configuration file This avoids problems when values are strings containing colons. And it mimicks what was already done for the salt-minion's configuration file. Fixes #233. --- salt/files/master.d/f_defaults.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 29b5f8a..9b0d87c 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -5,11 +5,11 @@ {% set cfg_master = cfg_salt.get('master', {}) -%} {%- macro get_config(configname, default_value) -%} {%- if configname in cfg_master -%} -{{ configname }}: {{ cfg_master[configname] }} +{{ configname }}: {{ cfg_master[configname]|json }} {%- elif configname in cfg_salt and configname not in reserved_keys -%} -{{ configname }}: {{ cfg_salt[configname] }} +{{ configname }}: {{ cfg_salt[configname]|json }} {%- else -%} -#{{ configname }}: {{ default_value }} +#{{ configname }}: {{ default_value|json }} {%- endif -%} {%- endmacro -%} {%- from 'salt/formulas.jinja' import file_roots, formulas with context -%}