Salt is a tool which is used for remote exection, configuration management, code deployment and communication topologies. Salt competes with popular cofiguration management tools like chef and puppet. Salt claims to scale up to tens and thousands of servers. Salt is used by one of the social networking giants Linkedin for their infrastructure management.Salt has a very shallow learning curve and you can get going quickly.
- There is a master server and it connects to the agent servers (called minions) in your infrastructure.
- The master can run commands in the minions parallelly, it is what make salt very fast.
- The minions will execute the command sent by master and return it.
Also Read: Opscode Chef Configuration Management tool setup
Returners: Using which you can redirect the return object of executed code to any system which can accept data, like reddis, mongodb, or a PostgresSQL database.
In salt you can git as a source repository and pull the source files to server them to minions.
In this tutorial, am goin to set the salt master in RHEL and salt minion in Ubuntu 13.04.
Setting up salt master on RHEL6:
1. Enable the EPEL repo
2. Install the salt master package using yum
3. Set the salt-master service to start on system boot
4. Start the salt master
If you want both the master and minion in one server, you can install the minion in the same server using yum command. Here am going to use a separate server for installing minion.
1. Add the salt repository
2. Update the repo database
3. Install salt minion
Configuring salt Master:
By default salt master listens to post 4505 and 4506. So make sure these ports are open in Iptables and any firewall if any. If you are using AWS instance , make sure these ports are open in the security groups.
Configuring salt minion:
By default salt minion listens to 4505 and 4506 , so make these ports are opened as mentioned above.
Open the /etc/salt/minion and uncomment the master option and give your masters ip
By default you have the hostname “salt”. You can use the same name if you edit your /etc/hosts file and make an entry for your salt master with name “salt”.
Registering minion with the master:
1. Start the minion
2. The above command will contact the master with keys for authentication.
3. Go to salt master and issue the following command to see it has any requests for authentication from new minions.
4. You will see the hostame of the minion under unauthorized keys.
5. Accept the keys using the following command
6. Once you accept the keys from minion , it will be registered with the master and the master can now issue commands to the minion.
7. You can list the minions using the following commands.
Testing master minion connection:
1. You can check the master minion connection using the simple salt ping test. It gives you output as "true"
If you want to re-register a minion to the master delete the existing minion key from the master using the following command
Restart the minion after deleting the key and start it again to register it with new keys.
Salt has a GUI called Halite, which is in pre-alpha stage.
Kindly share the article and leave a comment for queries. -