-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to retrieve external pillars with pillar.get when ext_pillar_first is True #37905
Comments
pillar.get
when ext_pillar_first
is set up.
I guess, that the person, who introduced |
From the documentation it says that the ext_pillar_first is only used for the targeting pillars in the top file. It does not mention being able to reference them inside other pillars. |
@gtmanfred, hm, actually you are right. Strange, that I had strong expectation, that it should work with |
Somehow I got this working: in my setup I'm able to access external pillars from pillars via opts dictionary. So, neither However, it does not work from pillar top file, but top files can match by external pillars anyway, so should not be a big problem. |
Actually, and I can spin off another issue if necessary as I'm not intending to hijack this thread, but {{ salt['pillar.get']('foo') }}, or {{ pillar['foo'] }} or any variation thus far I've tried even in the /srv/pillar/top.sls fails. The most I've been able to get is either None, or via a pillar.get('foo', 'meh') get it to say meh cause the pillar.get fails to retrieve anything. In my case, I'm actually pulling a number of pieces of information from a Galera cluster based on minion_id and then populating some pillar['metadata'] dicts which I then utilize for various states and additional pillar (ex/in)clusions. The only thing I've gotten to work currently is using the {{ opts['pillar']['foo']['bar'] }} solution in a file off of top.sls as @secumod mentioned. Salt Version: Dependency Versions: System Versions: |
Again, ext_pillar_first is only used for targeting pillars in the top file. Not referencing them in jinja in the top file. So what you are doing is the correct way to handle this. Closing this issue. Thanks, |
@gtmanfred, I'm not sure you understood me. If I try to use salt.get, pillar[], pillar.get, etc from the top file to call another pillar file, I get various errors, or None. And given the lack of documentation about ext_pillar_first or example usage, I'm not sure that I'm necessarily doing anything wrong and that there isn't a bug in ext_pillar_first itself. Again, I'm happy to open another bug report on this even if I think the issue is related. |
Also, just to clarify: my option of |
@gtmanfred, hi, look at this comment: This issue became relevant again, because the documentation changed and the phrase about targeting was removed. |
Description of Issue/Question
ext_pillar_first
master settings is supposed to make user able to reference external pillars from regular ones. At least this is my understanding and I'm not sure if it's correct.The issue is that while this setting makes possible to reference external pillars from regular ones using
pillar
context variable, it is still impossible to reference them with functionpillar.get
.I'm actually not really sure if it's a bug or I'm missing something.
Setup
Master config
Pillar top
main.sls
Steps to Reproduce Issue
salt '*' pillar.items
spam
variable, value for which was obtained by accessingpillar
, is set correctly. Butqux
variable, for whichpillar.get
call was used, isNone
.Versions Report
Related issues
#6955
#37003
The text was updated successfully, but these errors were encountered: