From 825fd7cd77ab34fcf750af580d7c040a8b2ff734 Mon Sep 17 00:00:00 2001 From: jpic Date: Thu, 6 Aug 2015 11:35:20 +0200 Subject: [PATCH] Fixed pillar_roots generation for salt-master. With a simple pillar like this:: $ sudo salt-call --config-dir /srv/etc/bootstrap --pillar-root /srv/pillar pillar.get salt:pillar_roots local: ---------- base: - /srv/pillar This was generated in /etc/salt/master.d/f_defaults.conf:: # highstate format, and is generally just key/value pairs. pillar_roots:base:- /srv/pillar # Resulting in parse errors by salt:: $ sudo salt '*' state.highstate [ERROR ] Error parsing configuration file: /etc/salt/master.d/f_defaults.conf - while scanning a simple key in "", line 531, column 1: pillar_roots:base:- /srv/pillar ^ could not found expected ':' in "", line 532, column 1: # ^ [ERROR ] Error parsing configuration file: /etc/salt/master.d/f_defaults.conf - while scanning a simple key in "", line 531, column 1: pillar_roots:base:- /srv/pillar ^ could not found expected ':' in "", line 532, column 1: # ^ This patch will fix it as such:: ID: salt-master Function: file.recurse Name: /etc/salt/master.d Result: True Comment: Recursively updated /etc/salt/master.d Started: 11:37:12.946823 Duration: 6255.296 ms Changes: ---------- /etc/salt/master.d/f_defaults.conf: ---------- diff: --- +++ @@ -528,7 +528,9 @@ # Pillar is laid out in the same fashion as the file server, with environments, # a top file and sls files. However, pillar data does not need to be in the # highstate format, and is generally just key/value pairs. -pillar_roots:base:- /srv/pillar +pillar_roots: + base: + - /srv/pillar # Resulting in:: # highstate format, and is generally just key/value pairs. pillar_roots: base: - /srv/pillar # --- salt/files/master.d/f_defaults.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 5aaef11..209c47a 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -652,12 +652,12 @@ pillar_roots: {%- for dir in roots %} - {{ dir }} {%- endfor -%} -{% endfor %} -{%- elif 'pillar_roots' in cfg_salt -%} +{%- endfor -%} +{% elif 'pillar_roots' in cfg_salt -%} pillar_roots: -{%- for name, roots in cfg_salt['pillar_roots']|dictsort -%} +{%- for name, roots in cfg_salt['pillar_roots']|dictsort %} {{ name }}: -{%- for dir in roots -%} +{%- for dir in roots %} - {{ dir }} {%- endfor -%} {%- endfor -%}