Created
January 22, 2015 15:50
-
-
Save kjlubick/c42bd229c46cf44d22b6 to your computer and use it in GitHub Desktop.
Ansible Runner to stop nginx
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
import ansible.runner | |
from ansible.inventory import Inventory | |
runner = ansible.runner.Runner( | |
module_name='shell', | |
module_args='nginx -s stop', | |
pattern='*', | |
sudo=True, | |
forks=10, | |
inventory=Inventory('inventory') | |
) | |
datastructure = runner.run() | |
print( datastructure ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment