mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +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
1 changed files with 16 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue