Salt Calls

Salt Calls

Salt calls are defined by three main properties:

salt 'target' <function> [arguments]

Use the second property in a Salt call to target a single machine or group of machines. Specify the client or group of clients you would like to run a function on.

General Targeting

List available grains on all clients:

salt '*'

Ping a specific client:

salt ''
Glob Targeting

Ping all clients using a domain:

salt '*'

Display the OS name of all clients with the webserver label:

salt 'webserver*' grains.item oscodename
List Targeting
salt -L ','
Regular Expression Targeting

You may use PCRE-compliant regular expressions:

salt -E '(?!web)'
IP Address Targeting

List client IP addresses:

salt '*' network.ip_addrs

Ping a specific client IP address:

salt -S ''

Ping all clients on a subnet:

salt -S
Lookup a Subnet Using the ip Command

You can use the ip command to find the subnet mask in the format of

ip -o -f inet addr show | awk '/scope global/ {print $4}'

Once you have specified a target, provide the function you would like to call. Functions also accept arguments. Arguments are space-delimited, for example:

salt '*' 'echo "Hello: $FIRST_NAME"' env='{FIRST_NAME: "John"}'
Locating Additional Minion Functions

Find more functions which can be called on clients by running:

salt '*' sys.doc

For a full list of callable functions, see


Provides the extra data needed by a function you are calling. The command pkg.install requires an argument specifying a package to install. YaST has been selected for installation, for example:

salt '*' pkg.install yast2