SlideShare a Scribd company logo
Configuration
Management
and
Salt
David Spencer
Bradford Linux Users Group
14 November 2016
So you’ve got a new lappie
you know the routine
wipe Windows, install Linux
add your favourite applications
customise the user environment
Remembered everything?
Bookmarks? passwords? documents?
Consistent with your desktop box?
So you’ve got a new job
lots of systems, big mess
and heaven knows you’re miserable now
What’s installed where?
Are they all set up right?
Are they all secure?
Are they all up to date?
lappie problem
job problem
these have the same solution
(maybe a tiny bit overengineered for just one lappie)
Configuration Management
control
single source of truth
captured and version managed
the power to make it happen
repeatably
scale
manage thousands as if they were one
https://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
https://www.emir.works/configuration-management-battlefield/
http://blog.takipi.com/deployment-management-tools-chef-vs-puppet-vs-ansible-vs-saltstack-vs-fabric/
Comparison
Ansible
The name "Ansible" references a fictional instantaneous
hyperspace communication system (as featured in
Orson Scott Card's Ender's Game (1985), and originally
invented by Ursula K. Le Guin for her novel Rocannon's
World (1966)).
Provisioning
Configuration Management
Application Deployment
Continuous Delivery
Security and Compliance
Orchestration
Puppet
Chef
bash awk grep perl sed df du
vi troff su fsck rm * halt awk awk awk
which brings us on to ...
Salt
daft name
“When looking for a name for the project, I was watching the Lord of the Rings and the
topic of “salted pork” came up. Then it hit me: salt makes everything better. Thus the
name Salt—because it makes system management better.”
Unrelated to libsodium, nacl, ...
daft non-metaphors (pillars, grains, mines)
“This is called the grains interface, because it presents salt with grains of information”
free software
“SaltStack is the company behind Salt”
“Salt is 100% committed to being open-source, including all of our APIs. It is
developed under the Apache 2.0 license”
Implementation
Python – modular – extensible
ZeroMQ message handling
YAML configuration
Jinja2 templating
With or without agent
master
Config files
Rendering
State system
Secure message bus
minions
Secure message bus
Execute & return results
Structure
Terminology
● target — which minions do I mean?
– a list, or a wildcard, or the whole roster
● state — what do I want to end up with?
– declarative, not imperative
● module — what will Salt do to make it happen?
– install, configure, remove files/packages,
hiding differences between platforms
– run commands
Terminology
All that complexity
just to end up with
the equivalent of a
shell script?
● target — which minions do I mean?
– a list, or a wildcard, or the whole roster
● state — what do I want to end up with?
– declarative, not imperative
● module — what will Salt do to make it happen?
– install, configure, remove files/packages,
hiding differences between platforms
– run commands
Terminology
● grain — data about the minion, calculated and stored
on the minion when the minion starts
– operating system, hardware ...
● pillar — data about the minion, configured on the
master (by you)
– server roles, config parameters, secrets, ...
● file server — somewhere on the master where you
can keep files you’re going to send to the minion
– nothing special, but has templating, can access git
Setup
● Install distro salt-master package on master
● Either
– Install distro salt-minion package on minions
– start master and minion daemons
– exchange keys
● Or
– Copy public ssh key to minions
and use salt-ssh (agentless)
● Then write and test configuration files
Configuration: YAML
Data structures as text
application independent
transformable to JSON
Off-the-shelf config format
Ugly, and picky as heck
until you compare it to XML
https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html
apache2:
pkg:
- installed
service:
- running
- enable: True
- reload: True
Configuration: Jinja2
Template engine
because YAML
isn’t sufficient
apache2:
pkg:
- installed
service:
- running
- enable: True
- reload: True
{% if 'htpasswd' in pillar %}
/etc/apache2/htpasswd:
file.managed:
- contents_pillar: htpasswd
- makedirs: True
{% endif %}
variable substitution
conditionals
loops
includes, macros
data structures
access to grains/pillars
# WRONG
# The Jinja in this YAML comment is still executed!
# {% set got_apache = 'apache' in salt.pkg.list_pkgs() %}
# OFFICIAL SOLUTION
# The Jinja in this Jinja comment will not be executed.
{# {% set got_apache = 'apache' in salt.pkg.list_pkgs() %} #}
# BETTER SOLUTION
# more readable, doesn’t insert a blank line
# {# {% set got_apache = 'apache' in salt.pkg.list_pkgs() %} #}
When worlds collide
YAML is indentation sensitive (like Python)
so you can't use indentation to make Jinja readable
YAML and Jinja are replaceable (but people tend not to)
Commands
salt [options] '<target>' <function> [arguments]
salt-ssh [options] '<target>' <function> [arguments]
salt-key salt-call salt-run
salt '*' test.ping
salt-ssh '*' -r 'df -k'
salt-ssh '*' pkg.list_upgrades
salt-ssh '*' system.reboot
salt-ssh newbox state.apply apache2
salt '*' state.highstate test=True
salt mylappie chocolatey.install wireshark
salt -G 'os:Windows' chocolatey.upgrade
salt '*' system.reboot
Chocolatey + Salt
a sane way to manage
a network of
Windows boxes
Only part of a bigger picture
Provisioning
Cloud, Containers
Monitoring
Workflow
Where do you stop?
Clever stuff
● Runners
– depending on one minion,
do something on another
(orchestration)
● Events
– another application
writes to message bus,
master reacts
● Cloud; Topology; Python API
Salt isn’t very good at...
● Cleaning up obsolete states, random bodges
● Random operational stuff (pssh/ClusterSSH)
● Facilitating the handling of secrets
● Expressing dependencies
● Expressing simple things simply (YAML limitations)
Behold! the hellspawn of Cobol, Reverse Polish and Dokuwiki!
(but at least it's not XML or Ruby)
● Orthogonality (why can’t I have a list? wildcards?)
● Module documentation: “how” and “why”
● Prototyping; debugging your config
– salt target state.apply newsls test=True
Salt isn’t very good at...
● Atypical use cases
● Unholy mix of policy rules, roles for instances, raw data
● “Formulas” not well signposted, mostly atrocious
Salt is quite good at...
●
Configuration management :-)
● Not trashing your boxes when you mess up
● Respectful, constructive bugtracker dialogues
that date from 2014, went nowhere, and are still open
Resources
Formulas
https://github.com/saltstack-formulas
and plagiarism
Documentation
https://docs.saltstack.com/en/latest/contents.html
Tutorials
https://docs.saltstack.com/en/latest/topics/tutorials/
Salt best practices
https://docs.saltstack.com/en/latest/topics/best_practices.html
FAQ
https://docs.saltstack.com/en/latest/faq.html
Books
(preferably the PACKT one, top right)

More Related Content

What's hot

Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Software, Inc.
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
Jonathan Weiss
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
Pravin Mishra
 
AWS Meetup - Sydney - February
AWS Meetup - Sydney - February AWS Meetup - Sydney - February
AWS Meetup - Sydney - February
markghiasy
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Software, Inc.
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
John Ewart
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Chef
 
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Simplilearn
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
Jennifer Davis
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
Bryan Berry
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Chef Software, Inc.
 
Learning chef
Learning chefLearning chef
Learning chef
Jonathan Carrillo
 
Getting started with Chef
Getting started with ChefGetting started with Chef
Getting started with Chef
Edureka!
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local Mode
Michael Goetz
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS Newbies
Mamun Rashid, CCDH
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
Chef
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
Ygor Nascimento
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
Chef Software, Inc.
 
Opscode tech festa july 2013
Opscode tech festa   july 2013Opscode tech festa   july 2013
Opscode tech festa july 2013
Chef Software, Inc.
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Chef
 

What's hot (20)

Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
AWS Meetup - Sydney - February
AWS Meetup - Sydney - February AWS Meetup - Sydney - February
AWS Meetup - Sydney - February
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
Learning chef
Learning chefLearning chef
Learning chef
 
Getting started with Chef
Getting started with ChefGetting started with Chef
Getting started with Chef
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local Mode
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS Newbies
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Opscode tech festa july 2013
Opscode tech festa   july 2013Opscode tech festa   july 2013
Opscode tech festa july 2013
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
 

Similar to Configuration Management and Salt

#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
Cédric Delgehier
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
Rui Lapa
 
Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014
vespian_256
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous Integration
Nicolas Fränkel
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
Raul Leite
 
zLAMP
zLAMPzLAMP
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
Michael Zhang
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
ViSenze - Artificial Intelligence for the Visual Web
 
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server EditionInstallation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Sammy Fung
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
Puppet
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaS
Appsembler
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
Roman Rodomansky
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
daoswald
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
Fernando Lopez Aguilar
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
FIWARE
 
Boulder_OneStop_presentation
Boulder_OneStop_presentationBoulder_OneStop_presentation
Boulder_OneStop_presentationThomas Jaensch
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
DevOps Ltd.
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
drupalindia
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
Kris Buytaert
 

Similar to Configuration Management and Salt (20)

#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
 
Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous Integration
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 
zLAMP
zLAMPzLAMP
zLAMP
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
 
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server EditionInstallation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server Edition
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaS
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
 
Boulder_OneStop_presentation
Boulder_OneStop_presentationBoulder_OneStop_presentation
Boulder_OneStop_presentation
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 

Recently uploaded

Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 

Recently uploaded (20)

Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 

Configuration Management and Salt

  • 2. So you’ve got a new lappie you know the routine wipe Windows, install Linux add your favourite applications customise the user environment Remembered everything? Bookmarks? passwords? documents? Consistent with your desktop box?
  • 3. So you’ve got a new job lots of systems, big mess and heaven knows you’re miserable now What’s installed where? Are they all set up right? Are they all secure? Are they all up to date?
  • 4. lappie problem job problem these have the same solution (maybe a tiny bit overengineered for just one lappie)
  • 5. Configuration Management control single source of truth captured and version managed the power to make it happen repeatably scale manage thousands as if they were one
  • 7. Ansible The name "Ansible" references a fictional instantaneous hyperspace communication system (as featured in Orson Scott Card's Ender's Game (1985), and originally invented by Ursula K. Le Guin for her novel Rocannon's World (1966)). Provisioning Configuration Management Application Deployment Continuous Delivery Security and Compliance Orchestration
  • 9. Chef bash awk grep perl sed df du vi troff su fsck rm * halt awk awk awk
  • 10. which brings us on to ...
  • 11. Salt daft name “When looking for a name for the project, I was watching the Lord of the Rings and the topic of “salted pork” came up. Then it hit me: salt makes everything better. Thus the name Salt—because it makes system management better.” Unrelated to libsodium, nacl, ... daft non-metaphors (pillars, grains, mines) “This is called the grains interface, because it presents salt with grains of information” free software “SaltStack is the company behind Salt” “Salt is 100% committed to being open-source, including all of our APIs. It is developed under the Apache 2.0 license”
  • 12. Implementation Python – modular – extensible ZeroMQ message handling YAML configuration Jinja2 templating With or without agent
  • 13. master Config files Rendering State system Secure message bus minions Secure message bus Execute & return results Structure
  • 14. Terminology ● target — which minions do I mean? – a list, or a wildcard, or the whole roster ● state — what do I want to end up with? – declarative, not imperative ● module — what will Salt do to make it happen? – install, configure, remove files/packages, hiding differences between platforms – run commands
  • 15. Terminology All that complexity just to end up with the equivalent of a shell script? ● target — which minions do I mean? – a list, or a wildcard, or the whole roster ● state — what do I want to end up with? – declarative, not imperative ● module — what will Salt do to make it happen? – install, configure, remove files/packages, hiding differences between platforms – run commands
  • 16. Terminology ● grain — data about the minion, calculated and stored on the minion when the minion starts – operating system, hardware ... ● pillar — data about the minion, configured on the master (by you) – server roles, config parameters, secrets, ... ● file server — somewhere on the master where you can keep files you’re going to send to the minion – nothing special, but has templating, can access git
  • 17. Setup ● Install distro salt-master package on master ● Either – Install distro salt-minion package on minions – start master and minion daemons – exchange keys ● Or – Copy public ssh key to minions and use salt-ssh (agentless) ● Then write and test configuration files
  • 18. Configuration: YAML Data structures as text application independent transformable to JSON Off-the-shelf config format Ugly, and picky as heck until you compare it to XML https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html apache2: pkg: - installed service: - running - enable: True - reload: True
  • 19. Configuration: Jinja2 Template engine because YAML isn’t sufficient apache2: pkg: - installed service: - running - enable: True - reload: True {% if 'htpasswd' in pillar %} /etc/apache2/htpasswd: file.managed: - contents_pillar: htpasswd - makedirs: True {% endif %} variable substitution conditionals loops includes, macros data structures access to grains/pillars
  • 20. # WRONG # The Jinja in this YAML comment is still executed! # {% set got_apache = 'apache' in salt.pkg.list_pkgs() %} # OFFICIAL SOLUTION # The Jinja in this Jinja comment will not be executed. {# {% set got_apache = 'apache' in salt.pkg.list_pkgs() %} #} # BETTER SOLUTION # more readable, doesn’t insert a blank line # {# {% set got_apache = 'apache' in salt.pkg.list_pkgs() %} #} When worlds collide YAML is indentation sensitive (like Python) so you can't use indentation to make Jinja readable YAML and Jinja are replaceable (but people tend not to)
  • 21. Commands salt [options] '<target>' <function> [arguments] salt-ssh [options] '<target>' <function> [arguments] salt-key salt-call salt-run salt '*' test.ping salt-ssh '*' -r 'df -k' salt-ssh '*' pkg.list_upgrades salt-ssh '*' system.reboot salt-ssh newbox state.apply apache2 salt '*' state.highstate test=True
  • 22. salt mylappie chocolatey.install wireshark salt -G 'os:Windows' chocolatey.upgrade salt '*' system.reboot Chocolatey + Salt a sane way to manage a network of Windows boxes
  • 23. Only part of a bigger picture Provisioning Cloud, Containers Monitoring Workflow Where do you stop?
  • 24. Clever stuff ● Runners – depending on one minion, do something on another (orchestration) ● Events – another application writes to message bus, master reacts ● Cloud; Topology; Python API
  • 25. Salt isn’t very good at... ● Cleaning up obsolete states, random bodges ● Random operational stuff (pssh/ClusterSSH) ● Facilitating the handling of secrets ● Expressing dependencies ● Expressing simple things simply (YAML limitations) Behold! the hellspawn of Cobol, Reverse Polish and Dokuwiki! (but at least it's not XML or Ruby) ● Orthogonality (why can’t I have a list? wildcards?) ● Module documentation: “how” and “why” ● Prototyping; debugging your config – salt target state.apply newsls test=True
  • 26. Salt isn’t very good at... ● Atypical use cases ● Unholy mix of policy rules, roles for instances, raw data ● “Formulas” not well signposted, mostly atrocious Salt is quite good at... ● Configuration management :-) ● Not trashing your boxes when you mess up ● Respectful, constructive bugtracker dialogues that date from 2014, went nowhere, and are still open
  • 27. Resources Formulas https://github.com/saltstack-formulas and plagiarism Documentation https://docs.saltstack.com/en/latest/contents.html Tutorials https://docs.saltstack.com/en/latest/topics/tutorials/ Salt best practices https://docs.saltstack.com/en/latest/topics/best_practices.html FAQ https://docs.saltstack.com/en/latest/faq.html Books (preferably the PACKT one, top right)