HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

salt — Execute commands and assert state on remote salt minions. More information: <https://docs.saltprojec

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandcommandsassertandsaltexecutestatecli

Problem

How to use the salt command: Execute commands and assert state on remote salt minions. More information: <https://docs.saltproject.io/en/latest/ref/cli/index.html>.

Solution

salt — Execute commands and assert state on remote salt minions. More information: <https://docs.saltproject.io/en/latest/ref/cli/index.html>.

List connected minions:
salt '*' test.ping


Execute a highstate on all connected minions:
salt '*' state.highstate


Upgrade packages using the OS package manager (apt, yum, brew) on a subset of minions:
salt '*.example.com' pkg.upgrade


Execute an arbitrary command on a particular minion:
salt '{{minion_id}}' cmd.run "ls "

Code Snippets

List connected minions

salt '*' test.ping

Execute a highstate on all connected minions

salt '*' state.highstate

Upgrade packages using the OS package manager (apt, yum, brew) on a subset of minions

salt '*.example.com' pkg.upgrade

Execute an arbitrary command on a particular minion

salt '{{minion_id}}' cmd.run "ls "

Context

tldr-pages: common/salt

Revisions (0)

No revisions yet.