What is Saltstack and How to Install It
In this tutorial you will know what is Salt, how to install it and a Quick commands to get you started.
What is Salt ?
Salt is an infrastructure and package management tool, it will help you to automate packaging, infrastructure installation and package management.
Salt is a different approach to infrastructure management, founded on the idea that high-speed communication with large numbers of systems can open up new capabilities. This approach makes Salt a powerful multitasking system that can solve many specific problems in an infrastructure.
The backbone of Salt is the remote execution engine, which creates a high-speed, secure and bi-directional communication net for groups of systems. On top of this communication system, Salt provides an extremely fast, flexible, and easy-to-use configuration management system called Salt States.
#1 Using YUM Repo
You can simply add the following to your Yum repo
name=SaltStack repo for Red Hat Enterprise Linux $releasever
Yum clean expire-cache
Yum clean all
yum install salt-master
#2 Install Saltstack "Masterless"
curl -L https://bootstrap.saltstack.com -o bootstrap_salt.sh
sudo sh bootstrap_salt.sh
In this top.sls we will put the name of the server, you can add webserver as a word or whatever and then create sls to match the name, now I want Salt to do server tuning so I will call it tuning.
Now create a new file webserver.sls , and will show you later how tuning is used
I will create another file called tuning.sls that I mentioned earlier in the top.sls
You can in the tuning create user, change filesystem...etc , check available options here.
To make Salt run the above recipe locally, run below command
salt-call --local state.apply