Install
NB: Use sudo -i to run as super user
Installation
Installation
Ubuntu Install
- Add the key:
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add - - Add the source to /etc/apt/sources.list
printf '%s\n%s\n' 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main' | sudo tee -a /etc/apt/sources.list - Update sources:
sudo apt-get update - Install the salt-minion, salt-master, or other Salt components:
apt-get install salt-master
apt-get install salt-minion
apt-get install salt-ssh
apt-get install salt-syndic
apt-get install salt-cloud
Alternative Install
Server:
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sudo sh install_salt.sh -P -M
sudo sh install_salt.sh -P -M
Install Client:
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sh install_salt.sh -P
NB: If you get the error:
ERROR: Failed to run install_ubuntu_stable_deps()!!!
ERROR: Failed to run install_ubuntu_stable_deps()!!!
Then try this process instead:
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
printf '%s\n%s\n' 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main' | sudo tee -a /etc/apt/sources.list
wget -O - https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
printf '%s\n%s\n' 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest trusty main' | sudo tee -a /etc/apt/sources.list
apt-get update
Then install the relevant components:
apt-get install salt-master
apt-get install salt-minion
apt-get install salt-ssh
apt-get install salt-syndic
apt-get install salt-cloud
Configuration
Configure Server
Network interface/port
Salt master listens on ports 4505 and 4506 on all interfaces (0.0.0.0).
To change the ip
service salt-master restart
service salt-master restart
Check service is running:
service salt-server status
service salt-server status
Keys
- Print the master key fingerprint:
salt-key -F master - Copy the master.pub fingerprint from the Local Keys section, and set this in the minions
Configure Minion
Salt uses ports 4505 and 4506 which need to be open on the master only. These need to be open on your router/firewall (they will be opened by the install of the master on the master itself). If not enable the firewall e.g. ufw enable && ufw enable 4505 on Ubuntu
- Either configure DNS to resolve 'salt' to the master or edit the config:
vi /etc/salt/minion
master: [host/ip of master machine] - Configure the master's key (or accept it on the master see below):
Set the master's key as the master_finger in the minion configuration file. - Restart the salt minion service:
service salt-minion restart - Check its running:
service --status-all
service salt-minion status
NB: If setting multiple masters:
master:
- address1
- address2
master_type: failover or str
random_master: True
master:
- address1
- address2
master_type: failover or str
random_master: True
Accept Minion Key on Master
- List the keys:
salt-key -L - Accept all or one:
salt-key -A
salt-key -A [hostname]
Delete Minions
Remove all Minions that aren't currently connected:
salt-run manage.down removekeys=True
salt-run manage.down removekeys=True
Test Connection
- On the Master:
Return the status of the Minions:
salt '*' test.ping
Return the ip addresses of the Minions:
salt '*' network.ip_addrs - On the Minion:
salt-minion -l debug
Next: Control a Minion
No comments:
Post a Comment