Skip to content

Instantly share code, notes, and snippets.

@jalons

jalons/restart_a Secret

Last active August 29, 2015 14:13
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 jalons/3edbf6ce81e090cc4a1f to your computer and use it in GitHub Desktop.
Save jalons/3edbf6ce81e090cc4a1f to your computer and use it in GitHub Desktop.
import salt.client
def restart():
client = salt.client.LocalClient(__opts__['conf_file'])
minions = client.cmd(tgt='some_key:ASIDE', fun='service.restart', expr_form='grain', timeout=1)
import salt.client
def restart():
client = salt.client.LocalClient(__opts__['conf_file'])
minions = client.cmd('*', 'service.restart', timeout=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment