Skip to content

Commit

Permalink
JSON encode values embedded in the salt-master's configuration file
Browse files Browse the repository at this point in the history
This avoids problems when values are strings containing colons. And it
mimicks what was already done for the salt-minion's configuration file.

Fixes saltstack-formulas#233.
  • Loading branch information
rhertzog committed Jun 20, 2016
1 parent a96f709 commit 182098f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions salt/files/master.d/f_defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down

0 comments on commit 182098f

Please sign in to comment.