I'm having issues getting a custom pillar to load.
ext_pillar:
- cmd_json: 'echo {\"arg\":\"value\"}'
Then my dir looks like
[mike@ops /usr/share/pyshared/salt/pillar]$ ls /usr/share/pyshared/salt/pillar
cmd_json.py cobbler.py etcd.py hiera.py libvirt.py pillar_ldap.py reclass_adapter.py
cmd_yaml.py django_orm.py git_pillar.py __init__.py mongo.py puppet.py virtkey.py
So I have an etcd.py file in the same dir cmd_json is and that works
etcd.py
# -*- coding: utf-8 -*-
# Import python libs
import logging
import urllib
import json
# Import salt libs
import salt.utils
from salt._compat import string_types
# Set up logging
log = logging.getLogger(__name__)
def ext_pillar(minion_id, pillar, url):
log.info("Querying etcd at %r for information for %r", url, minion_id)
try:
response = urllib.urlopen(url);
data = json.loads(response.read())
out = {'recurly': []}
for node in data['node']['nodes']:
out['recurly'].append(node['value'])
except Exception:
log.exception(
'Could not connect to etcd.'
)
return {}
return out
In my master I get the following
[INFO ] Executing command 'echo {\\"arg\\":\\"value\\"}' in directory '/root'
[DEBUG ] output: {"arg":"value"}
[CRITICAL] Specified ext_pillar interface etcd is unavailable
So cmd_json is loading but my etcd isn't I don't see much else in the debug output to say why
thanks!