salt-proxy with external pillar not working
we are trying to use salt-proxy with external pillar. for that we have our own custom module that takes the minion id as arg in ext_pillar function and form an api url ,from where we will get the data for proxy.
/usr/lib/python2.7/dist-packages/salt/pillar/network_pillar.py def ext_pillar(minion_id, pillar, # pylint: disable=W0613 url=None): ''' Read pillar data from HTTP response.
:param url String to make request
:returns dict with pillar data to add
:returns empty if error
'''
opts=salt.config.minion_config('/etc/salt/master.d/integration.conf')
token=opts["api"]["authorization.token"]
baseurl='{}?where={{%22entityid%22:%22{}%22}}'.format(url, minion_id)
res=requests.get(baseurl, headers={ 'Authorization': token }, verify=False).json()
return salt.utils.router_parse.router_pillar(res) ----> this is another function inside utils which will do the parsing and resturn the dict for proxy like below:
{"proxy": {"proxytype": "napalm","driver": "ios","host": "192.168.43.2","username": "cognizant","password": "automation"}}
but when we run salt-proxy --proxyid=<minion_id>, we accept the keys, but after that it fails and says no pillar/opts data for proxy to connect. So basically at these point the salt proxy in unable to use data from external pillar.
These is master config file ext_pillar:
- cloud_router_pillar: url: http://10.236.220.196:5000/api/v1/viewentities
- network_pillar: url: https://uat2-harmony.cognizantgoc.com/api/v1/viewentities
I dont know what`s the issue here...also if i do salt
@Set4now i just tested with external pilar of git and it worked fine in my proxy setup.
If you test this custom external pillar with a normal minion setup does it work?
also @cro might have some insight here as well
Hey. It has been resolved. It came out to be an issue with the API proxy data. Thanks am closing this out.