expr_form for ip adresses

16 views
Skip to first unread message

shrey....@invicto.in

unread,
Apr 27, 2017, 7:32:39 AM4/27/17
to Salt-users
hi, 

how can i make this work using python apis
salt -S 192.168.122.13 test.ping

192.168.122.13 is ip for 'window-minion'

local.cmd('window-minion','test.ping') 
here its the 'glob', expr_form
i can see the expr_from for grains and all, but what exactly is used for IP adresses?

Thanks for any help

Daniel Wallace

unread,
Apr 27, 2017, 11:22:01 AM4/27/17
to Salt-users
We really need to document this somewhere else, but if you search for
`expr_form` under the `cmd` function on the LocalClient, you will see
the list of all of the matcher types that you can use.

And looking closer that needs to be updated.

They are listed in `salt.utils.minions:CkMinions` and are `_check_<type>_match`

https://github.com/saltstack/salt/blob/develop/salt/utils/minions.py#L455

It looks like 'S' matches up with 'ipcidr'

Daniel
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/salt-users/4293339d-1d64-4480-8144-97b24adec7ff%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

shrey....@invicto.in

unread,
Apr 28, 2017, 6:01:09 PM4/28/17
to Salt-users
I did look for 'expr_form' under 'cmd' function on local client, but could not find any option for ip as i said i could find options like 'grains', 'glob' etc but not for ip
 
any way 'ipcidr' does solve the problem, thanks mate

Thomas Phipps

unread,
Apr 28, 2017, 6:19:46 PM4/28/17
to Salt-users
the documentation although iffy and in need of editing can be found in targeting minions part of the main documentation. here https://docs.saltstack.com/en/latest/topics/targeting/
which points to the sub topic of https://docs.saltstack.com/en/latest/topics/targeting/ipcidr.html

however this part of the documentation really could use a ton of work. 


--
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/d/optout.
--
Thomas Phipps
Linux/Openstack/Logstash

Reply all
Reply to author
Forward
0 new messages