Empty mine.get results

1,636 views
Skip to first unread message

Patrick Vinas

unread,
Jul 26, 2013, 1:04:58 PM7/26/13
to salt-...@googlegroups.com
Hello, the list-

I'm trying to deploy a salt proof of concept, and I'm having some trouble with salt-mine.  I have
mine_functions:
  grains.item:
    - roles   (a custom grain I've added)
  network.ip_addrs: []
  test.ping: []
in /etc/salt/minion.  I've restarted the salt-minion service and, just to be safe, run mine.update.  However, when I run
salt '*' mine.get '*' '*'
I get
salt-minion2:
    ----------
salt-minion1:
    ----------
A grains.get roles, for example, gives the expected output
salt-minion2:
    - openstack
    - compute
salt-minion1:
    - openstack
    - controller

I guess I'm doing something wrong, but I'm not sure what.  Can anyone shed some light?  Thanks in advance!

Colton Myers

unread,
Jul 26, 2013, 4:48:49 PM7/26/13
to salt-...@googlegroups.com
This looks correct.  Is there anything in the master/minion debug output from when you update the mine that might point to the problem?

--
Colton Myers


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Colton Myers

unread,
Jul 26, 2013, 4:52:50 PM7/26/13
to salt-...@googlegroups.com
Oh, can you also give us the output of `salt --versions-report`?  There were some mine issues back in the 0.15 days, it may just be a version problem.

--
Colton Myers

Patrick Vinas

unread,
Jul 26, 2013, 5:23:41 PM7/26/13
to salt-...@googlegroups.com
salt@salt-master:~/$ salt --versions-report
           Salt: 0.16.0
         Python: 2.7.3 (default, Apr 10 2013, 06:20:15)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.4.1
         PyYAML: 3.10
          PyZMQ: 13.0.0
            ZMQ: 3.2.2

There's nothing in master or minion log files, salt-call mine.update -l debug prints out the usual DEBUG messages, then
 
local: True
 
and salt '*' mine.update outputs:
salt-minion2:
    True
salt-minion1:
    True


Colton Myers

unread,
Jul 26, 2013, 5:24:53 PM7/26/13
to salt-...@googlegroups.com
Hrm.....could you create an issue, please?  https://github.com/saltstack/salt/issues/new

--
Colton Myers


Thomas S Hatch

unread,
Jul 26, 2013, 6:23:59 PM7/26/13
to salt-...@googlegroups.com
I did not see the command you were running to get the mine data, try:
salt \* mine.get \* grains.item

Thomas S. Hatch  |  Founder, CTO


5272 South College Drive, Suite 301 | Murray, UT 84123

Patrick Vinas

unread,
Jul 30, 2013, 2:09:34 PM7/30/13
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? 

Jens Rantil

unread,
Mar 25, 2014, 9:51:36 AM3/25/14
to salt-...@googlegroups.com
Hi,

Just saw nobody answered to the question below.


Den tisdagen den 30:e juli 2013 kl. 20:09:34 UTC+2 skrev Patrick Vinas:

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? 


Use mine to publish "network.ipaddrs" (possibly with "eth0" parameter). You can then easily query the IP adresses of minions.

Cheers,
Jens
Reply all
Reply to author
Forward
0 new messages