SALT(1)

✨ SALT ✨

okay bestie, welcome to salt(1) β€” yes that's the manual name, yes it's literally just "salt", the naming team was feeling minimal that day πŸ’… but the tool? iconic. it lives in the Salt manual and it's about to change your whole remote-systems situation.


🌸 NAME 🌸

salt β€” salt πŸ§‚ (yes the name is just the name, we love a low-effort legend)


πŸŽ€ SYNOPSIS πŸŽ€

salt '*' [ options ] sys.doc

salt -E '.*' [ options ] sys.doc cmd

salt -G 'os:Arch.*' [ options ] test.version

salt -C 'G@os:Arch.* and webserv* or G@kernel:FreeBSD' [ options ]
test.version

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically Salt lets you run commands across a whole swath of remote systems in parallel. like, all at once. at the same time. no cap. that means all those remote systems can be controlled and queried with total ease. it's giving "main character of your infrastructure" energy fr fr πŸ‘‘


πŸ’œ OPTIONS πŸ’œ

  • --version β€” prints the version of Salt that's running. vibe check for your install ✨
  • --versions-report β€” shows the program's dependencies and version number, then dips out (exits). πŸšͺ
  • -h, --help β€” shows the help message and exits. the classic "bestie help me" move 🫢
  • -c CONFIG_DIR, --config-dir=CONFIG_dir β€” where the Salt configuration directory lives. this dir holds the config files for the Salt master and the minions. on most systems the default location is /etc/salt. 🏠
  • -t TIMEOUT, --timeout=TIMEOUT β€” the timeout in seconds to wait for replies from the Salt minions. this number says how long the command line client will wait to query the minions and check on running jobs. Default: 5 ⏰
  • -s, --static β€” okay so as of version 0.9.8, the salt command returns data to the console as it's received from minions, but older releases would only return data after all of it was received. use the static option to only return the data with a hard timeout and after all minions have returned. without the static option, you get a separate JSON string per minion, which makes the JSON output invalid as a whole 😭 (iykyk)
  • --async β€” instead of waiting for the job to run on minions, it only prints the job id of the started execution and completes. set it and forget it energy πŸ’…
  • --subset=SUBSET β€” execute the routine on a random subset of the targeted minions. the minions get verified that they actually have the named function before executing. the SUBSET argument is the count of minions to target. 🎲
  • -v VERBOSE, --verbose β€” turn on verbosity for the salt call. this makes the salt command print out extra data, like the job id. not me wanting all the tea β˜•
  • --hide-timeout β€” instead of showing the return data for all minions, this option prints only the online minions which could be reached. πŸ™ˆ
  • -b BATCH, --batch-size=BATCH β€” instead of executing on all targeted minions at once, execute on a progressive set of minions. this option takes an argument that's either an explicit number of minions to execute at once, or a percentage of minions to execute on. 🐌✨
  • --batch-wait=BATCH_WAIT β€” wait the specified time in seconds after each job is done before freeing the slot in the batch for the next one. patience is a vibe 🌸
  • --batch-safe-limit=BATCH_SAFE_LIMIT β€” execute the salt job in batch mode if the job would have executed on at least this many minions. πŸ›‘οΈ
  • --batch-safe-size=BATCH_SAFE_SIZE β€” the batch size to use for batch jobs created by --batch-safe-limit. πŸ“
  • -a EAUTH, --auth=EAUTH β€” pass in an external authentication medium to validate against. the credentials will be prompted for. the options are auto, keystone, ldap, and pam. can be used with the -T option. πŸ”
  • -T, --make-token β€” used in conjunction with the -a option. this creates a token that lets the authenticated user send commands without needing to re-authenticate. no more typing passwords every five seconds, we love efficiency πŸ’…
  • --return=RETURNER β€” choose an alternative returner to call on the minion. if an alternative returner is used, the return will not come back to the command line β€” it gets sent to the specified return system instead. the options are carbon, cassandra, couchbase, couchdb, elasticsearch, etcd, hipchat, local, local_cache, memcache, mongo, mysql, odbc, postgres, redis, sentry, slack, sms, smtp, sqlite3, syslog, and xmpp. 🌈
  • -d, --doc, --documentation β€” return the documentation for the module functions available on the minions. self-care for your brain 🧠
  • --args-separator=ARGS_SEPARATOR β€” set the special argument used as a delimiter between command arguments of compound commands. this is useful when one wants to pass commas as arguments to some of the commands in a compound command. πŸ“

πŸ“ Logging Options πŸ“

these are the logging options, which override any settings defined on the configuration files. they said "your config can't sit with us" πŸ’…

  • -l LOG_LEVEL, --log-level=LOG_LEVEL β€” console logging log level. one of all, garbage, trace, debug, info, warning, error, quiet. Default: warning.
  • --log-file=LOG_FILE β€” log file path. Default: /var/log/salt/master. πŸ“‚
  • --log-file-level=LOG_LEVEL_LOGFILE β€” logfile logging log level. one of all, garbage, trace, debug, info, warning, error, quiet. Default: warning.

🎯 Target Selection 🎯

the default matching that Salt uses is shell-style globbing around the minion id. see https://docs.python.org/3/library/fnmatch.html#module-fnmatch.

  • -E, --pcre β€” the target expression gets interpreted as a PCRE regular expression rather than a shell glob. 🧚
  • -L, --list β€” the target expression gets interpreted as a comma-delimited list; example: server1.foo.bar,server2.foo.bar,example7.quo.qux. πŸ“‹
  • -G, --grain β€” the target expression matches values returned by the Salt grains system on the minions. the target expression is in the format of '<grain value>:<glob expression>'; example: 'os:Arch*'
this was changed in version 0.9.8 to accept glob expressions instead of regular expression. to use regular expression matching with grains, use the --grain-pcre option. ⚠️
  • --grain-pcre β€” the target expression matches values returned by the Salt grains system on the minions. the target expression is in the format of '<grain value>:< regular expression>'; example: 'os:Arch.*'
  • -N, --nodegroup β€” use a predefined compound target defined in the Salt master configuration file. πŸ‘‘
  • -R, --range β€” instead of using shell globs to evaluate the target, use a range expression to identify targets. range expressions look like %cluster.
using the Range option requires that a range server is set up and the location of the range server is referenced in the master configuration file. ⚠️
  • -C, --compound β€” utilize many target definitions to make the call very granular. this option takes a group of targets separated by and or or. the default matcher is a glob as usual. if something other than a glob is used, preface it with the letter denoting the type; example: 'webserv* and G@os:Debian or E@db*' make sure the compound target is encapsulated in quotes. πŸ”₯
  • -I, --pillar β€” instead of using shell globs to evaluate the target, use a pillar value to identify targets. the syntax for the target is the pillar key followed by a glob expression: "role:production*" πŸ›οΈ
  • -S, --ipcidr β€” match based on Subnet (CIDR notation) or IPv4 address. 🌐

πŸ’– Output Options πŸ’–

  • --out β€” pass in an alternative outputter to display the return of data. this outputter can be any of the available outputters:
highstate, json, key, overstatestage, pprint, raw, txt, yaml,
and many others.

some outputters are formatted only for data returned from specific functions. if an outputter is used that does not support the data passed into it, then Salt will fall back on the pprint outputter and display the return data using the Python pprint standard library module. 🐍

  • --out-indent OUTPUT_INDENT, --output-indent OUTPUT_INDENT β€” print the output indented by the provided value in spaces. negative values disable indentation. only applicable in outputters that support indentation. πŸ“
  • --out-file=OUTPUT_FILE, --output-file=OUTPUT_FILE β€” write the output to the specified file. πŸ’Ύ
  • --out-file-append, --output-file-append β€” append the output to the specified file. πŸ“Ž
  • --no-color β€” disable all colored output. 🚫🌈
  • --force-color β€” force colored output. 🌈
NOTE: when using colored output the color codes are as follows: green denotes success, red denotes failure, blue denotes changes and success and yellow denotes a expected future change in configuration.
  • --state-output=STATE_OUTPUT, --state_output=STATE_OUTPUT β€” override the configured state_output value for minion output. one of 'full', 'terse', 'mixed', 'changes' or 'filter'. Default: 'none'.
  • --state-verbose=STATE_VERBOSE, --state_verbose=STATE_VERBOSE β€” override the configured state_verbose value for minion output. set to True or False. Default: none.
NOTE: if you're using --out=json, you will probably want --static as well. without the static option, you'll get a separate JSON string per minion, which makes the JSON output invalid as a whole. this is due to using an iterative outputter. so if you want to feed it to a JSON parser, use --static as well. bestie please, just use --static 😭

πŸ”Ž SEE ALSO πŸ”Ž

salt(7) salt-master(1) salt-minion(1)


✍️ AUTHOR ✍️

Thomas S. Hatch <thatch45@gmail.com> and many others, please see the Authors file 🫢


2025


and that's the whole thing, periodt πŸ’… this was salt(1) from the Salt manual, version 3007.8, and the page was generated on September 18, 2025 at 06:58:52 UTC. go forth and run commands across a swath of remote systems in parallel, you absolute icon πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from