Dzahn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/276890

Change subject: salt-misc: add new target_type role (WIP)
......................................................................

salt-misc: add new target_type role (WIP)

Change-Id: I79d539c77e870ea8b5495630c35b13b777088dfd
---
M salt-misc/do_ssh_commands.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/90/276890/1

diff --git a/salt-misc/do_ssh_commands.py b/salt-misc/do_ssh_commands.py
index 6df8d7d..e61e5b3 100755
--- a/salt-misc/do_ssh_commands.py
+++ b/salt-misc/do_ssh_commands.py
@@ -56,6 +56,8 @@
         return ['-L', target]
     elif target_type == 'facter':
         return ["'*'"]
+    elif target_type == 'role':
+        return ["--out raw"]
     else:
         return None
 
@@ -67,7 +69,7 @@
     '''
     if target_type == 'facter':
         command = ['cmd.run', "'facter %s'" % target.split(':')[0]]
-    elif target_type == 'grain':
+    elif target_type == 'grain' or target_type == 'role':
         command = ['test.ping']
         command.extend(target.split(':'))
     elif (target_type == 'list' or target_type == 'glob'
@@ -214,7 +216,7 @@
         sys.stderr.write("\n")
     usage_message = """
 Usage: do-ssh-commands.py --target <string>
-         [--type glob|list|facter|grain]
+         [--type glob|list|facter|grain|role]
          [--realm prod|labs|beta] [--dryrun]
          command arg1 arg2....'minion' ...argn
 OR     do-ssh-commands.py --help
@@ -250,6 +252,7 @@
                          list of hosts
                  grain:  the target is of the form grainname:value
                  facter: the target is of the form factername:value
+                 role:   the target is of the form role::value
                  mia:    hosts that don't respond to test.ping
                          in this case the target must be a
                          string with a possible wildcard in it

-- 
To view, visit https://gerrit.wikimedia.org/r/276890
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79d539c77e870ea8b5495630c35b13b777088dfd
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Dzahn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to