Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.


Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.


Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.


Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells, Featured

Quick Setup of Salt on CentOS/RHEL

Submitted by on August 21, 2014 – 2:58 pm

Just some quick notes on installing and configuring Salt master server and minions to run remote commands for various sysamdin needs.

Installing Salt Master

[label type=”important”]Note[/label]¬†you may need to enable EPEL repo. For some quick instructions, check here.

yum install salt-master -y
chkconfig salt-master on

Edit /etc/salt/master and add a line “interface: master_ip_address”, where “master_ip_address” is the IP address of the Salt master server’s primary network interface to be used for Salt-related tasks. Once the “interface” line is added, start Salt master:
service salt-master start

 Installing Salt Minions

yum install salt-minion -y
chkconfig salt-minion on
echo "master: master_ip_address" >> /etc/salt/minion
service salt-minion start

You can also use FQDN or even short hostname for the Salt Master, as long as the minion node can correctly resolve it. However, if you do use a hostname instead of IP, it is a good idea to have the corresponding entry in /etc/hosts on every minion and not rely on DNS. You wouldn’t want to lose your entire Salt environment if DNS becomes unavailable.

Adding Keys

You request the key from a specific Salt minion by running:

salt-key -a minion_node

In this case, “minion_node” is the FQDN of a particular Salt minion. This will not automatically add the minion’s key to the Salt inventory: it will just put it on the “pending” list. To view pending keys and accept them, run the following on the Salt master:
salt-key -L # to view what's what
salt-key -A # to accept everything

Running Remote Commands

Just a few simple remote execution commands:

[root@saltshaker salt]# salt '*'

[root@saltshaker salt]# salt '*' "uname -a ; uptime"
    Linux 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
     14:56:22 up 170 days, 23:36,  2 users,  load average: 0.00, 0.01, 0.00
    Linux 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
     14:56:22 up 202 days,  3:18,  0 users,  load average: 0.05, 0.18, 0.19


Print Friendly, PDF & Email

Leave a Reply