SaltStack Working Example - SaltStack

What is the working example of saltstack?

In this working example, we will make a Salt formula that will design the apache web server alongside the PHP software. Salt is an extraordinary method to execute specially appointed commands, yet you would not by any means need to ceaselessly Configure your framework along these lines. By making a set of Salt formulas, you can dependably duplicate any configuration over.

Salt Formulas are basic YAML content Files and as a matter of course live on your Salt Master in/srv/salt/*. Give us a chance to start by making a Salt Formula to install the Apache web server and PHP in the meantime.

Make a File named "websetup.sls" under/srv/salt/registry and include the below code.

websetup.sls

In this model, see the "- pkgs:" contention. Everything in the list below "- pkgs:" will be passed together to OS's package chief to be installed together. At whatever point you have a substantial list of packages to install this is the most effective approach to install them.

Let’s see this formula of Salt master using the following command.

Find below output –

Let’s install the packages in minion2.

Highstate

A “highstate” is a process to know the Salt Formulas to be applied to a certain minion. Now run a “highstate” with below command.

top.sls

At the point when the follower demand to execute a highstate, as referenced previously, the flunky asks for the top.sls from the Salt master and scans for formulas that it matches. As a matter of course, this File is situated at/srv/salt/top.sls set minion as a target.

Presently, execute the highstate focusing on minion2 as demonstrated as follows.

In the wake of applying this, you could see the below output –

Presently, Apache web server and PHP is installed in the minion2. Along these lines, we need to target minions utilizing both top.sls and highstate and install the required software with insignificant work and most extreme adaptability.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SaltStack Topics