Skip to content

Instantly share code, notes, and snippets.

@aryou
Created September 17, 2015 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aryou/b1d8e595734622b562cc to your computer and use it in GitHub Desktop.
Save aryou/b1d8e595734622b562cc to your computer and use it in GitHub Desktop.
custom runner
# -*- 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