Show Menu
Cheatography

SaltStack Cheat Sheet (DRAFT) by

Practical SaltStack Cheat Sheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Docume­ntation

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 mystat­efile
mystat­efi­le.sls applied to min*
salt 'min*' state.sls prod.s­omefile
prod/s­ome­fil­e.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.a­ctive
get list of active jobs
salt-run jobs.l­ist­_jobs
get list of historic jobs
alt-run jobs.l­ook­up_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.li­st_­upg­rades
list packages that need upgrade
salt '*' pkg.ve­rsion bash
get version of bash package
salt '*' pkg.in­stall bash
instal­l/u­pgrade bash package
salt '*' pkg.in­stall bash refres­h=True
instal­l/u­pgrade but refresh package database
salt '*' servic­e.s­tatus <se­rvice name>
Service status?
salt '*' servic­e.a­vai­lable <se­rvice name>
Service available?
salt '*' servic­e.start <se­rvice name>
Service start
salt '*' servic­e.r­estart <se­rvice name>
Service restart
salt '*' servic­e.stop <se­rvice name>
Service stop