Patrick Vinas
unread,Jul 30, 2013, 2:09:34 PM7/30/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to salt-...@googlegroups.com
salt '*' mine.get '*' grains.items works!
However, and this is probably because I'm trying to do something wrong again, when I stick salt['mine.get']('roles:controller', 'network.ip_addrs', 'grain') into the pillar/openstack/init.sls on the master, I get the following error:
_errors:
- Rendering SLS openstack failed, render error:
- Traceback (most recent call last):
- File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 63, in render_tmpl
- output = render_str(tmplstr, context, tmplpath)
- File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 116, in render_jinja_tmpl
- output = jinja_env.from_string(tmplstr).render(**context)
- File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
- return self.environment.handle_exception(exc_info, True)
- File "<template>", line 2, in top-level template code
- File "/usr/lib/pymodules/python2.7/salt/modules/mine.py", line 149, in get
- auth = _auth()
- File "/usr/lib/pymodules/python2.7/salt/modules/mine.py", line 21, in _auth
- __context__['auth'] = salt.crypt.SAuth(__opts__)
- File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 427, in __init__
- self.crypticle = self.__authenticate()
- File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 439, in __authenticate
- self.opts.get('_safe_auth', True)
- File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 266, in sign_in
- self.opts['master'],
- KeyError: 'master'
-
And of course, even if that were to work, I suspect that it would be reporting the IP of the salt-master, rather than the minion's IP.
Does anyone have any helpful advice on how to write a simple query against the "roles" custom grain, to return the IP address of the minion that matches "roles:controller"? I thought salt mine was going to be the ticket, but maybe I need to do minion publishing instead?