Created
September 17, 2015 15:58
-
-
Save aryou/b1d8e595734622b562cc to your computer and use it in GitHub Desktop.
custom runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
MyRunner | |
''' | |
from __future__ import absolute_import | |
# Import salt modules | |
import salt.client | |
if __name__ == "__main__": | |
print "WTF" | |
def __virtual__(): | |
return 'myrunner' | |
def up(): | |
''' | |
Print a list of all of the minions that are up | |
''' | |
client = salt.client.LocalClient(__opts__['conf_file']) | |
minions = client.cmd('*', 'test.ping', timeout=1) | |
for minion in sorted(minions): | |
print minion | |
import salt.config | |
import salt.loader | |
import salt.runner | |
import salt.client | |
def test(): | |
print "Hello World!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment