======Salt====== >>{{{toc levels="h2,h3,h4"}}}>> =====SaltStack Server===== ====Related Links==== [[https://docs.saltstack.com/en/latest/topics/installation/rhel.html|SaltStack Docs]] [[https://docs.saltstack.com/en/latest/topics/installation/index.html|SaltStack Installation]] [[https://docs.saltstack.com/en/latest/topics/tutorials/walkthrough.html|SaltStack Walkthrough]] [[https://docs.saltstack.com/en/latest/ref/modules/all/index.html|SaltStack Execution Modules]] [[https://www.youtube.com/watch?v=Dkd51QlNmO0|Getting Started with SaltStack Video]] ===Internal Links=== SaltStackEC2 ====Common Commands==== When salt command is issued on salt-master the command will be run as local root on the client. ~- Currently looking into passing other credentials as local root has no access to nfs When salt command is issued on salt-master all targeted minions must be reachable for command to run. Salt will display an error for those clients that it was unable to reach but will take no further action or queuing to apply actions when minion becomes available. ~- Investigate queuing for offline/unavailable clients %% Server salt '*' pkg.refresh_db # check for yum/dnf updates salt '*' pkg.upgrade # run updates using yum on minions salt '*' pkg.install package_name # install package using yum salt '*' cmd.run 'ls -l /etc' # run a command on minion salt-key -d 'ws100*' # delete key; required if minion rebuilt salt-key -a 'ws*' # accept key(s) for workstations salt-run manage.status # What is the status of all my minions? (both up and down) salt-run jobs.active # get list of active jobs salt-run jobs.list_jobs # get list of historic jobs salt-run jobs.lookup_jid # get details of this specific job salt 'minion1' network.ip_addrs # Get IP of your minion salt 'minion1' network.ping # Ping a host from your minion salt 'minion1' state.sls