SaltStack
CONFIGURATION MANAGEMENT, LARGE & SMALL.
By Joël, from Fictive Kin
Slide 2
Slide 2 text
Created by Mark Burgess.
Used a DSL to hide platform
differences.
CFEngine
Anomaly detection, machine
learning, secure communications.
CFEngine 2
1993
1998
Slide 3
Slide 3 text
Declarative XML model,
validation done via schema.
Allowed “auditing” of off-book
changes on machines.
BCFG2
DSL, core written in Ruby.
System facts discovered,
manifests compiled to catalogs
with dependencies.
Puppet
2004
2005
Slide 4
Slide 4 text
Ruby (mostly).
Reusable “recipes” grouped
together as “cookbooks”.
Collects facts in Solr that
recipes can query.
Chef
Written in Python.
Remote command execution,
infrastructure-as-code, highly-
modular.
SaltStack (!)
2009
2011
Slide 5
Slide 5 text
Minimalist - only requires SSH on
target machines, reusable
playbooks, quick to get started.
Ansible
Combination of monitoring,
anomaly detection, provisioning,
reporting, idempotent system
theory
Who Knows?
2012
2015-?
Slide 6
Slide 6 text
Configuration
Which packages need to be installed, and how they are
configured.
Slide 7
Slide 7 text
ed, and how they are
Provisioning
How many servers/nodes/
containers are necessary? In
what topology?
Slide 8
Slide 8 text
Deployment
Install packages and run configuration scripts on relevant
servers, avoiding race conditions. Two-phase deploys are
your friend.
what topology?
Slide 9
Slide 9 text
Which packages need to be insta
configured.
Debugging
There’s nothing quite like
deploying major architecture
changes and it not working as
expected. So we DO IT LIVE.
Slide 10
Slide 10 text
Configuration
Which packages need to be installed, and how they are
configured.
Slide 11
Slide 11 text
A Better Approach
SANITY IN COMPLEXITY
Slide 12
Slide 12 text
Declarative Logic
Data vs. State
Remote Execution
Targeting
Slide 13
Slide 13 text
Declarative Logic
EXPRESS LOGIC WITHOUT CONTROL FLOW.
WHAT SHOULD BE ACCOMPLISHED, NOT HOW.
Slide 14
Slide 14 text
Data vs. State
SEPARATE DATA FROM STATE.
DATA HELPS CONFIGURE VARIABLE PARTS OF STATE.
Slide 15
Slide 15 text
Remote Execution
RUN ARBITRARY COMMANDS ON REMOTE HOSTS.
Slide 16
Slide 16 text
Master/Minion
Slide 17
Slide 17 text
Master: Compiles states & data to send to targets.
Minion: Authenticated agent on target runs commands.
Multi-Master: Hot master setup; minions need list of masters.
Slide 18
Slide 18 text
Security
Slide 19
Slide 19 text
Asymmetric encryption between master and minions for authentication.
Can seed minions with pre-generated keys.
AES-encrypted msgpack-serialized communication payload over
ZeroMQ.
Slide 20
Slide 20 text
Declarative Logic
Slide 21
Slide 21 text
The basic state (or SLS) definition can be
written in as a YAML dictionary.
The states are mapped to targets in
top.sls.
Slide 22
Slide 22 text
base:
‘web*’:
-‐
webserver
/var/salt/roots/top.sls
/var/salt/roots/webserver.sls
nginx:
#
ID
declaration
pkg:
#
state
declaration
-‐
installed
#
function
declaration
Slide 23
Slide 23 text
States can include other states, and can
declare dependencies to other state
functions.