You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a dynamic pillar, which on request makes a call to some API, acquire some data and return it as pillar data. I'm making the pillar using the python renderer.
Everything works well when I'm using the "salt-call --local" command, but when I'm using the setup as master/minion, I have some issues.
In the dynamic pillar, I have a function "run", which returns the result for the pillar. In this function, I'm trying to get some data which is needed to make the API calls, and this data is stored in another pillar (users). I saw that in this case I have a predefined variable "pillar" which holds the data for any existing pillars so far. So, in the python code for the dynamic pillar if I have "log.error(pillar)" I'm getting all the pillar data (from the users.sls in this example). This methods works very well, when I'm calling some state which use this pillar with "salt-call --local state.sls some-state". However, the same setup, when calling it like "salt 'minion' state.sls some-state", in the pillar, the "log.error(pillar)" prints an empty hash.
Setup
The setup can be simplified as this:
/srv/pillar/top.sls
'base':
'*':
- users
- dynamic-pillar
/srv/pillar/users.sls
users:
- user1
- user2
- user3
/srv/pillar/dynamic-pillar.sls
#!py
def run():
ret={}
log.error(pillar) #just to print the existing pillar data in the error log
ret['dynamic'] = pillar
return(ret)
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.0.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.5.0
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
The text was updated successfully, but these errors were encountered:
@gkrystev I think you are running into the feature request in this issue #6955 to add the ability to grab other pillar information from within pillars. It looks like there is currently some workarounds posted in that issue that you can take a look at there and try out until that feature has been implemented.
Ch3LL
added
Duplicate
Duplicate of another issue or PR - will be closed
Question
The issue is more of a question rather than a bug or a feature request
labels
Sep 6, 2016
Description of Issue/Question
I'm trying to write a dynamic pillar, which on request makes a call to some API, acquire some data and return it as pillar data. I'm making the pillar using the python renderer.
Everything works well when I'm using the "salt-call --local" command, but when I'm using the setup as master/minion, I have some issues.
In the dynamic pillar, I have a function "run", which returns the result for the pillar. In this function, I'm trying to get some data which is needed to make the API calls, and this data is stored in another pillar (users). I saw that in this case I have a predefined variable "pillar" which holds the data for any existing pillars so far. So, in the python code for the dynamic pillar if I have "log.error(pillar)" I'm getting all the pillar data (from the users.sls in this example). This methods works very well, when I'm calling some state which use this pillar with "salt-call --local state.sls some-state". However, the same setup, when calling it like "salt 'minion' state.sls some-state", in the pillar, the "log.error(pillar)" prints an empty hash.
Setup
The setup can be simplified as this:
/srv/pillar/top.sls
/srv/pillar/users.sls
/srv/pillar/dynamic-pillar.sls
Versions Report
msgpack-python: 0.4.6
msgpack-pure: Not Installed
pycrypto: 2.0.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.5.0
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
The text was updated successfully, but these errors were encountered: