mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add "nodegroup" matching to salt-ssh
Uses the special ssh_nodegroups config value, which only takes lists, not normal compound matching.
This commit is contained in:
parent
688a78c08c
commit
65c6528cbc
@ -89,6 +89,22 @@ class RosterMatcher(object):
|
||||
minions[minion] = data
|
||||
return minions
|
||||
|
||||
def ret_nodegroup_minions(self):
|
||||
'''
|
||||
Return minions which match the special list-only groups defined by
|
||||
ssh_nodegroups
|
||||
'''
|
||||
minions = {}
|
||||
nodegroup = __opts__.get('ssh_nodegroups', {}).get(self.tgt, [])
|
||||
if not isinstance(nodegroup, list):
|
||||
nodegroup = nodegroup.split(',')
|
||||
for minion in self.raw:
|
||||
if minion in nodegroup:
|
||||
data = self.get_data(minion)
|
||||
if data:
|
||||
minions[minion] = data
|
||||
return minions
|
||||
|
||||
def get_data(self, minion):
|
||||
'''
|
||||
Return the configured ip
|
||||
|
Loading…
Reference in New Issue
Block a user