Last active
February 7, 2018 17:42
-
-
Save doesitblend/0d8977c7bf69275409925f1b309198f8 to your computer and use it in GitHub Desktop.
Example LocalClient Returner Usage
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 the Salt Client library | |
import salt.client | |
# Instantiate the client with the default configuration | |
local = salt.client.LocalClient() | |
# Here we tell the master to put a job on the bus and to have all minions use the MySQL returner. | |
# Notice that data is returned to the Client as well as to the specified returner. | |
# Also note that we are specifying the targets, the function to run, arguments to that function, | |
# and then any keyword arguments that need to be supplied as well. This works similar to the CLI | |
# since this is what the CLI uses to execute jobs. | |
data = local.cmd('*', 'test.fib', [10], ret='mysql') | |
print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment