Book Image

Learning SaltStack

By : Colton Myers
Book Image

Learning SaltStack

By: Colton Myers

Overview of this book

Table of Contents (15 chapters)

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 20140906205638826307
-------------------------------------------

myminion:
    True

Here's a list of 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.

Command-line options

If you've spent any real amount...