Cheatography
https://cheatography.com
Practical SaltStack Cheat Sheet
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Documentation
salt '*' sys.doc |
All sys.doc |
salt '*' sys.doc pkg |
sys.doc for pkg |
salt '*' sys.doc network |
sys.doc for network |
salt '*' sys.doc system |
sys.doc for system |
salt '*' sys.doc status |
sys.doc for module status |
Minons
salt-run manage.status |
Minion status (both up and down) |
salt-run manage.up |
Show minions that are up |
salt-run manage.down |
Show minions that are down |
salt '*' test.ping |
Use test module to test minions |
Target minois with State files
salt 'min*' state.sls mystatefile |
mystatefile.sls applied to min* |
salt 'min*' state.sls prod.somefile |
prod/somefile.sls applied to min* |
|
|
Grains
salt '*' grains.ls |
List all grains on all minions |
salt '*' grains.item os |
Value of OS grain for every minion |
salt '*' grains.item roles |
Value of roles grain for every minion |
Jobs in Salt
salt-run jobs.active |
get list of active jobs |
salt-run jobs.list_jobs |
get list of historic jobs |
alt-run jobs.lookup_jid <job id> |
get details of specific job |
Sysadmin Specific Commands
salt 'min*' system.reboot |
reboot minions min* |
salt '*' status.uptime |
get uptime of all minions |
salt '*' pkg.list_upgrades |
list packages that need upgrade |
salt '*' pkg.version bash |
get version of bash package |
salt '*' pkg.install bash |
install/upgrade bash package |
salt '*' pkg.install bash refresh=True |
install/upgrade but refresh package database |
salt '*' service.status <service name> |
Service status? |
salt '*' service.available <service name> |
Service available? |
salt '*' service.start <service name> |
Service start |
salt '*' service.restart <service name> |
Service restart |
salt '*' service.stop <service name> |
Service stop |
|