Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

04. SaltStack files structure

Khelil Sator edited this page Jun 30, 2017 · 20 revisions

salt master:

salt master configuration file:

The salt-master is configured via the master configuration file
The configuration file for the salt-master is located at /etc/salt/master by default.
Documentation: https://docs.saltstack.com/en/latest/ref/configuration/master.html

file_roots:

Salt runs a file server to deliver files to minions.
This file server is built into the master daemon and does not require a dedicated port.
Default location is /srv/salt.
Configured via the file_roots option inside the master configuration file.
Example:

file_roots:
 base:
  - /srv/salt

pillar:

The default location for the pillar is in /srv/pillar.
The pillar location can be configured via the pillar_roots option inside the master configuration file. sls files.
the pillar has a top file.
Example:

pillar_roots:
 base:
  - /srv/pillar

state files:

SLS (SaLt State) files.
yaml format.
representation/description of the state in which a system should be in.
kind of ansible playbooks.

runners:

Salt runners work similarly to Salt execution modules however they execute on the Salt master itself instead of remote Salt minions.
you can execute runners with salt-run command.
You can set additional directories to search for runner modules with runner_dirs in the master configuration file.
Examples:

runner_dirs:
  - /srv/runners/

reactor files:

Reactor sls files should be placed in the /srv/reactor/ directory for consistency between environments, but this is not currently enforced by Salt.
Reactor sls files follow a similar format to other sls files in Salt.
They are written in YAML and can be templated using Jinja.

Example:

reactor:
  - 'jnpr/syslog/*/UI_COMMIT_COMPLETED':
        - /srv/reactor/on_commit.sls

reactor files to events mapping:

Reactor sls files are mapped to event in the section reactor of the master conf file /etc/salt/master or /etc/salt/master.d/reactor.conf
support for salt:// file paths.
Example:

reactor:
  - 'jnpr/syslog/*/UI_COMMIT_COMPLETED':
        - /srv/reactor/on_commit.sls

engines_dirs:

engines_dirs option in the Salt master or in the Salt minion configuration file has the list of directories under which Salt attempts to find Salt engines.
Example:

engines_dirs: 
  - /srv/engines

salt minion:

salt minion configuration file:

the salt-minion is configured via the minion configuration file.
By default, the salt-minion configuration will be in /etc/salt/minion.

engines_dirs:

engines_dirs option in the Salt master or in the Salt minion configuration file has the list of directories under which Salt attempts to find Salt engines.
Example:

engines_dirs: 
  - /srv/engines

salt-proxy configuration file:

Proxy minions can now be configured in /etc/salt/proxy or /etc/salt/proxy.d instead of just pillar.
Configuration format is the same as it would be in pillar.