Home Installation and Operations Manual

Configuration Node Setup

Configuring the Operating System

The configuration files will be installed to /etc/salt and are named after the respective components, /etc/salt/master, and /etc/salt/minion.

By default the Salt master listens on ports 4505 and 4506 on all interfaces (0.0.0.0). To bind Salt to a specific IP, redefine the “interface” directive in the master configuration file, typically /etc/salt/master, as follows:

- #interface: 0.0.0.0
+ interface: 10.0.0.1

After updating the configuration file, restart the Salt master. for more details about other configurable options. Make sure that mentioned ports are open by your network firewall.

Open salt master config

vim /etc/salt/master.d/master.conf

And set the content to the following, enabling dev environment and reclass metadata source.

file_roots:
  base:
  - /srv/salt/env/dev
  - /srv/salt/env/base

pillar_opts: False

reclass: &reclass
  storage_type: yaml_fs
  inventory_base_uri: /srv/salt/reclass

ext_pillar:
  - reclass: *reclass

master_tops:
  reclass: *reclass

And set the content to the following to setup reclass as salt-master metadata source.

vim /etc/reclass/reclass-config.yml
storage_type: yaml_fs
pretty_print: True
output: yaml
inventory_base_uri: /srv/salt/reclass

Configure the master service

# Ubuntu
service salt-master restart
# Redhat
systemctl enable salt-master.service
systemctl start salt-master

See the master configuration reference for more details about other configurable options.

Setting up package repository

Use curl to install your distribution’s stable packages. Examine the downloaded file install_salt.sh to ensure that it contains what you expect (bash script). You need to perform this step even for salt-master instalation as it adds official saltstack package management PPA repository.

apt-get install vim curl git-core
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sudo sh install_salt.sh

Install the Salt master from the apt repository with the apt-get command after you installed salt-minion.

sudo apt-get install salt-minion salt-master reclass

Note

Instalation is tested on Ubuntu Linux 14.04/16.04, but should work on any distribution with python 2.7 installed.

You should keep Salt components at current stable version.

Configuring Secure Shell (SSH) keys

Generate SSH key file for accessing your reclass metadata and development formulas.

mkdir /root/.ssh
ssh-keygen -b 4096 -t rsa -f /root/.ssh/id_rsa -q -N ""
chmod 400 /root/.ssh/id_rsa

Create SaltStack environment file root, we will use dev environment.

mkdir /srv/salt/env/dev -p

Get the reclass metadata definition from the git server.

git clone git@github.com:tcpcloud/workshop-salt-model.git /srv/salt/reclass

Get the core formulas from git repository server needed to setup the rest.

git clone git@github.com:tcpcloud/salt-formula-linux.git /srv/salt/env/dev/linux -b develop
git clone git@github.com:tcpcloud/salt-formula-salt.git /srv/salt/env/dev/salt -b develop
git clone git@github.com:tcpcloud/salt-formula-openssh.git /srv/salt/env/dev/openssh -b develop
git clone git@github.com:tcpcloud/salt-formula-git.git /srv/salt/env/dev/git -b develop