mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add minion data to the compound matcher
This commit is contained in:
parent
99fe305127
commit
98a969b45e
@ -23,6 +23,7 @@ L List of minions ``L@minion1.example.com,minion3.domain.com or bl*.do
|
||||
I Pillar glob match ``I@pdata:foobar``
|
||||
S Subnet/IP addr match ``S@192.168.1.0/24`` or ``S@192.168.1.100``
|
||||
R Range cluster match ``R@%foo.bar``
|
||||
D Minion Data match ``D@key:value``
|
||||
====== ==================== ===============================================================
|
||||
|
||||
Matchers can be joined using boolean ``and``, ``or``, and ``not`` operators.
|
||||
|
@ -1048,6 +1048,10 @@ class Matcher(object):
|
||||
if fnmatch.fnmatch(str(member).lower(), comps[1].lower()):
|
||||
return True
|
||||
return False
|
||||
if isinstance(val, dict):
|
||||
if comps[1] in val:
|
||||
return True
|
||||
return False
|
||||
return bool(fnmatch.fnmatch(
|
||||
val,
|
||||
comps[1],
|
||||
@ -1128,7 +1132,8 @@ class Matcher(object):
|
||||
'I': 'pillar',
|
||||
'L': 'list',
|
||||
'S': 'ipcidr',
|
||||
'E': 'pcre'}
|
||||
'E': 'pcre',
|
||||
'D': 'data'}
|
||||
if HAS_RANGE:
|
||||
ref['R'] = 'range'
|
||||
results = []
|
||||
|
Loading…
Reference in New Issue
Block a user