search by tags

for the user

adventures into the land of the command line

saltstack cheatsheet

On the Master

check keys

$ sudo salt-key -L

add key

$ sudo salt-key -a some_groovy_minion

delete key

$ sudo salt-key -d some_other_lame_minion

apply a state to everything

$ sudo salt '*' state.apply
$ sudo salt '*' state.highstate (older versions of salt)

dry run

$ sudo salt '*' state.apply test=True

apply a specific state

$ sudo salt '*' state.apply path.to.state

target by grains

$ sudo salt -G 'some_grain:some_value' state.apply

target by combination

$ sudo salt -C '*this or *that' state.apply

run in batches

$ sudo salt '*' state.apply -b 50

check some grain

$ sudo salt '*' grains.get ipv4

On a Minion

apply a state to everything

$ sudo salt-call state.apply
$ sudo salt-call state.highstate (older versions of salt)

dry run

$ sudo salt-call state.apply test=True

apply a specific state

$ sudo salt-call state.apply path.to.state

check some grain

$ sudo salt-call grains.get ipv4