Installing the salt-master and salt-minion
1. Deploy 2 Virtual Machines with Ubuntu 12.04 LTS (“Precise Pangolin”). One will be the master and one will be in the minion.2. Connect to each with PuTTy and log in with the user created during install.
Run These Commands on Both Servers:
3. Change user to
root
.sudo su -
4. Install the
python-software-properties
package.apt-get install python-software-properties
5. Add the SaltStack Repository.
add-apt-repository ppa:saltstack/salt
6. Update the package management database.
apt-get update
Run This Command on the salt-master Server:
7. Install
salt-master
.apt-get install salt-master
Run These Commands on the salt-minion Server:
8. Install
salt-minion
.apt-get install salt-minion
9. Edit the file
/etc/salt/minion
with vi
. Find the line “#master: salt”. Delete the “#”. Change“salt” to the FQDN or IP of the salt-master server.
vi /etc/salt/minionNote: To edit the file type “i”. To save and exit type “:wq” and “enter”.
The file should look like this:
10. Restart the
salt-minion
daemon.service salt-minion restart
Run These Commands on the salt-master Server:
11. Add the minion’s private key to the salt-master. “-L” lists all keys. “-A” accepts all new keys.
salt-key -L salt-key -A
12. Test the connection with
test.ping
Execution Module. The result should return true.salt "*" test.ping
The salt-master now has the ability to remotely execute against the salt-minion. Here are a couple of simple things it can do:
Return Disk Usage:
salt "*" disk.usage
Run Remote Commands:
salt "*" cmd.run "ls /var/log -la"
Install the
git
package:salt "*" pkg.install git
0 comments:
Post a Comment