Last Updated: 10/30/2024
WARNING: This article is also under construction.
SaltStack (also known as Salt) is a Python-based, open-source tool that helps system administrators manage and automate IT infrastructure, including servers, networks, and the cloud. A Salt stack is composed of a Salt-master and Salt-Minions.
The salt-minion is a single process that sits on machines to be managed by Salt. It can either operate as a stand-alone daemon which accepts commands locally via ‘salt-call’ or it can connect back to a master and receive commands remotely
Please see the documentation in the first Reference entry. it will detail your installation instructions for various Linux Distributions.
In this post we are going to run through a general installation, so that we can become familiar with the binaries, configurations files, and get an idea of the general use case. We may also need to become failiar with something called a “state”.
We are going to discuss installing a Salt master and Salt-mnion on Ubuntu.
sudo apt-get install salt-master
Life is nice for once. Now that we have installed the salt-master and salt-minion we need to know how to create a relationship between the two.
sudo systemctl restart salt-master
When :”salt-master” is installed it generates a set of keys that can be listed as.
salt-key -F master
Installing the salt-minion:
On the server that has been spun up, in this case named salt1 with ip 192.168.160.55.
apt install salt-minion
Configuring the Satt Minion- Link
From the master:
salt-key -L
salt-run manage.up
salt-run manage.status
salt-run manage.down
salt-run manage.alived
salt '*' grains.get id
Accepting the Salt-minions key – Link
To accept a key on the salt-master.
salt-key -a salt1
Send a test ping – Link
salt '*' test.version
To Run a command against all salt-minions:
salt '*' cmd.run 'apt upgrade -y'
Salt packages/modules: more about this in a moment.
- salt-common
- salt-ssh
- salt-syndic
- salt-cloud
- salt-api
Reference:
https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/ubuntu.html#install-salt-on-ubuntu-24-04-noble-amd64
https://docs.saltproject.io/en/latest/topics/development/architecture.html
https://docs.saltproject.io/salt/user-guide/en/latest/topics/states.html
https://docs.saltproject.io/salt/install-guide/en/latest/topics/configure-master-minion.html
https://docs.saltproject.io/en/latest/topics/targeting/index.html