salt: Entry in pillar top.sls with dot in path does not work
Hey folks,
with the version 0.14.0 it does not work to have a dot in a dirname which servers a pillar.
Example: As a top.sls in /srv/pillar
base:
'*'
- data
- dir.with.dot.in.dirname
With a pillar tree structure as follows: /srv/pillar/ /srv/pillar/top.sls /srv/pillar/data/init.sls /srv/pillar/dir.with.dot.in.dirname/init.sls
Issuing $ salt-call pillar.data --local will complain, that dir.with.dot.in.dirname was not found.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 1
- Comments: 39 (25 by maintainers)
And then, this was easier than I expected: 3. Using an ext_pillar, in particular PillarStack, with:
and:
and again eg:
This is what I’m leaning toward for my situation; this also has the added benefit of being able to reference these when setting normal other/pillar values (eg with
ext_pillar_first: true).I was wanting to do this today (store host-specific data in fqdn-named files). In case it’s valuable to anyone else coming here from a google search, as I did, I found these two approaches useful:
Leveraging @st0ne-dot-at’s post above and going with the aforementioned
_separator:and eg:
Of course, other separators could be used (
,=+etc). I tried several and couldn’t find any that substituted well enough for.to go with.Leveraging https://github.com/saltstack/salt/issues/23910#issuecomment-120371039, with:
and:
and eg:
I’m using the following workaround for fqdn specific pillar data:
The node specific file for server www.example.com is: /etc/salt/pillar/servers/com/example/www.sls ( = reversed fqdn )
…
/etc/salt/pillar/top.sls:
/etc/salt/pillar/servers/init.sls:
/etc/salt/pillar/servers/com/example/www.sls: