Exercise 10-1: Configuring salt Master and Minions

Topic Progress:

Exercise 1, Chapter 10 – Configuring a salt master and minion.

To configure a salt master and minion use commands similar to these. Note that some of the commands should be issued on the master, and some one the minion (or slave) as noted by the command prompts.

First, you should install the salt-master package on a server that is reachable by all the hosts that you want to manage and salt-minion on the hosts that you wish to manage. This will require two machines, or VM’s. Set up one first. For the sake of demonstration, you can use two a live boot instance.

On the machine you intend to be the master:

If you are using your ISO from Exercise 5, Chapter 9, you can use that as the minion’s install ISO. Otherwise, spin up another live VM for the minion and execute apt-get install salt-minion:

Next, each minion must be told where to find their master. Simply edit /etc/salt/minion and set the master key to the DNS name (or IP address) of the Salt master:

Each minion has a unique identifier stored in /etc/salt/minion_id, which defaults to its hostname. This minion identifier will be used in the configuration rules and as such, it is important to set it properly before the minion opens its connection to the master:

When the salt-minion service is running, it will try to connect to the Salt master to exchange some cryptographic keys. On the master side, you have to accept the key that the minion is using to identify itself to let the connection proceed. Subsequent connections will be automatic:

As soon as minions are connected, you can execute commands on them from the master. Examples: