ignore_missing would be ignored in pillar/top.sls

9 views
Skip to first unread message

stefa...@googlemail.com

unread,
Sep 13, 2022, 3:05:42 AMSep 13
to Salt-users

Hello,
My pillars/top.sls look like this:
'base':
 '{{ grains.fqdn }}':
   - ignore_missing: True
   - hosts.{{ grains.host }}

It works great if hosts.foobar exist, but if not I got an error, and that's why I'm confused becaus I set ignore_missing to True. Here is the output if I try a state.apply without an existing pillar:

salt 'openvpn*' state.apply
openvpn.aei.mpg.de:
   Data failed to compile:
----------
   Pillar failed to render with the following messages:                                                                                                                                                                                                                                                                     
----------
   Rendering SLS 'hosts.openvpn' failed. Please see master log for details.                                                                                                                                                                                                                                                 
ERROR: Minions returned with non-zero exit code


it would be very nice if someone can help me (salt-minion and master have version 3005)

Phipps, Thomas

unread,
Sep 13, 2022, 3:49:37 AMSep 13
to salt-...@googlegroups.com
the first thing to address is that grains.host should not be trusted. any minion can change its grains to any host and be able to pull any of the pillars that would be presented to other hosts. grains.id is the only grain that can be trusted in pillar. as that grain is set to the minion id on the master side.

next. I just tested ignore_missing, i also copy and pasted your example into my top.sls as is. and it worked fine for me on 3005. Which leads me to believe it could be any number of things that removes ignore_missing from the same indentation level as the actual pillar files. most likely a difference between space and tab. or some other whitespace issue.

also, start using the pillar commands to test. such as saltutil.pillar_refresh. and pillar.items. it will save time and you can work directly wit the pillar instead of waiting for a highstate.

also, if you look on the master. like the error says. what does the master say?

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/aede6f34-602a-4072-b089-7566913d9785n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages