Deploying Saltstack : master and minion (archlinux on ARM)

As part of a project to upgrade my servers (Sheevaplug and Cubieboards), I wanted to automate most of the OS and software deployments.

Moreover the idea was also to factorize configurations for all servers and be able to change and replay deployments easily… That’s exactly the purpose of an orchestrator like Puppets, Ansible or Saltstack.

I choosed Saltstack as it seemed the most simple to use to me without any compromise on functionalities (regarding my needs).

Below are my notes about this first install, as well as a little script to to even automate the minions deployment.

As some of my minions as well as my master run on low power arm computer (eg: raspberry or odroid c1), I changed the master configuration in /etc/salt/master to set the “timeout” property to 120 and the “worker_thread” to 8.

This allows to be more tolerant for slow answer as the master can wait up to 2 minutes for 8 command’s results.

At this time, salt is able to drive minions… but the true power of SaltStack is the templating of services: the states…

Configure States

Prepare folder architecture

States are configuration templates that are OS agnostic. Saltstack propose a directory and filename based logic to handle the whole thing.

There are basicaly 3 main directories to configure in “/etc/salt/master”:

file_roots : for states path

module_dirs: for modules (to create custom state’s actions)

pillar_roots: pillars (Salstack way of defining and assigning values to minions)

Example of structure :

/srv/salt/states/base
/srv/salt/pillar/base
/srv/salt/modules

A simple state

As an example, here is a state that remove “alarm” user and group on am Archlinuxarm distrib.

Create the folder “noalarmuser” in /srv/salt/states/base, then a file named “init.sls” with the following content: