The structure of a remote execution command
If you remember, our basic remote execution command looks like this:
# sudo salt '*' test.ping myminion: True
The basic Salt remote execution command is made up of five distinct pieces. We can easily see them if we look at the usage text for the salt
command, which is as follows:
# sudo salt --help Usage: salt [options] '<target>' <function> [arguments]
Let's inspect a command that uses all of these pieces:
# sudo salt --verbose '*' test.sleep 2 Executing job with jid 20160218032023792688 ------------------------------------------- myminion: True
Here are the pieces of a Salt command, including the relevant pieces of the last command that we ran:
- The Salt command:
salt
- Command-line options:
--verbose
- Targeting string:
'*'
- The Salt module function:
test.sleep
- Arguments to the remote execution function:
2
Let's briefly explore the purpose that each of these pieces serves.