The Salt system is a Python-based open-source remote execution framework for
configuration management, automation, provisioning and orchestration. A basic Salt
implementation consists of a Salt master managing one or more Salt minions.
configuration management, automation, provisioning and orchestration. A basic Salt
implementation consists of a Salt master managing one or more Salt minions.
Salt master:
A server running the salt-master service is a Salt master. The master provides a cohesive
platform for orchestration and automation between managed systems.
Salt minion:
A Salt minion is any system or device managed by Salt. A minion can either run the
salt-minion service or be agent less using salt-ssh or salt-proxy. A minion running the
service may execute commands without a master in stand-alone mode.
Salt proxy:
A Salt Proxy is used to execute commands on devices that are unable to run the minion
service. The proxy minion receives commands from a master, translates and transmits the
commands appropriate to the method of connection to the underlying device
(SSH, REST, etc.), and relays the results back to the master.
Salt SSH:
The Salt SSH system was added as an alternative means to communicate with minions.
It does not require that a minion be present on the target system, only that the
SSH service is running and port 22 is open.
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
sudo salt-run jobs.lookup_jid $job_id
sudo salt-run jobs.list_jobs search_target='MINION_ID' search_function='state.highstate'
sudo salt-run jobs.exit_success
sudo salt --async *com state.highstate queue=True
sudo salt *com saltutil.refresh_pillar
sudo salt '*' grains.ls
sudo salt '*' grains.items
sudo salt --async '*' saltutil.sync_all
sudo salt --async '*' state.highstate queue=True
sudo salt '*' test.ping
sudo ls -l /opt/saltroots
sudo salt '*' saltutil.refresh_pillar
sudo salt '*' --async state.apply base.base_users_groups
sudo salt '*' state.show_sls
reports minions' running versions and compares them to the master's:
salt-run manage.up
salt-run manage.status
salt-run manage.down
list keys:
salt-key -L
list all running jobs:
salt-run jobs.active
| Kill the job:
| kill all jobs:
| salt '*' saltutil.kill_all_jobs
| kill the job with id:
| salt '*' saltutil.kill_job <job id>
test version:
salt '*' test.version
sudo salt minionID cmd.run 'ls -l /etc' -- remotely run command on MINION
sudo salt minionID cmd.run 'tail -n100 /var/log/salt/minion'
salt minionID pillar.items
salt-call -l debug state.apply
sudo salt 'host1*' state.apply common.files.files test=True --- OCI
sudo salt 'host1*' state.apply common.files.templates test=True
sudo salt 'host1*' --async state.apply base.base_users_groups.updated_users --- classic
sudo salt --async 'host1*' state.highstate test=True --state-output=changes
sudo salt-call --local cmd.run --- run local salt command
salt -L `awk -vORS=, '{ print $1 }' min2 | sed 's/,$/\n/'` cmd.run 'grep "^User" /etc/sudoers'
for i in $(cat min);do sudo salt-key -L|grep ^$i>>min2;done
Comments
Post a Comment