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 version0.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. theSUBSETargument 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 areauto,keystone,ldap, andpam. can be used with the-Toption. π-T,--make-tokenβ used in conjunction with the-aoption. 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 arecarbon,cassandra,couchbase,couchdb,elasticsearch,etcd,hipchat,local,local_cache,memcache,mongo,mysql,odbc,postgres,redis,sentry,slack,sms,smtp,sqlite3,syslog, andxmpp. π-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 ofall,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 ofall,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 version0.9.8to accept glob expressions instead of regular expression. to use regular expression matching with grains, use the--grain-pcreoption. β οΈ
--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 byandoror. 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 configuredstate_outputvalue for minion output. one of'full','terse','mixed','changes'or'filter'. Default:'none'.--state-verbose=STATE_VERBOSE,--state_verbose=STATE_VERBOSEβ override the configuredstate_verbosevalue for minion output. set toTrueorFalse. Default:none.
NOTE: if you're using--out=json, you will probably want--staticas 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--staticas 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 π«Ά
Β©οΈ COPYRIGHT Β©οΈ
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
- fedora 44: salt-master 3007.8-4.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms