Sweetening Systems Management             with Salt                       #lspeSF Bay Area Large Scale Production Engineer...
What is Salt?                        http://saltstack.org● Relatively new project (<2 years old)● Started by Thomas Hatch,...
Key Features Overview  Remote Execution Framework● Master(s), Minions● All communications over ZeroMQ  ○ PUB-SUB for maste...
Key Features Overview  Remote Execution FrameworkConfiguration Management System Highly Modular and ExtensibleReadily Avai...
Salt in Puppet Terms                                puppet                       saltLanguage               Ruby          ...
Salt in Operation  Topologies master and minion   on same host
Salt in Operation  Topologies 1 master, N minions
Salt in Operation  TopologiesN masters, N minions
Salt in Operation           Topologies● peer-to-peer   ○ minions can publish     commands/states to each other     (via ma...
Salt in Operation  Key Management Minion public keys must beaccepted by the master before  communication can occur
Salt in Operation
Salt in Operation
Salt in Operation             Remote Execution    salt <target> <command> <options>● target - literal ID name, wildcards, ...
Show which grains are defined on a host
Show the values of all grains on a host
See disk space utilization on all database servers
Check status of a particular package on all hosts
See details of all network interfaces on a particular host
Collect MAC addresses from primary interfaces on all web servers
Run an arbitrary shell command on all hosts
Run arbitrary python code on all hosts, specifying which interpreter to use
Salt in Operation        State Management● simple syntax, lots of examples available● templatable● several (~25) state cla...
Applying a single state from the command line
Salt in Operation              State ManagementA simple ntpd state:ntp:  pkg:     - installed  service:     - name: ntpd  ...
Salt in Operation              State ManagementAdd a templated config file:/etc/ntp.conf:  file:    - managed    - require...
Applying a single state from an SLS definition
Applying full highstate to all hosts, dry-run (test=true)
Applying full highstate to all hosts, review changes in teal
All states have been fully applied to all systems!
http://saltstack.orghttp://talksum.com
Upcoming SlideShare
Loading in …5
×

Sweetening Systems Management with Salt

8,323 views
8,035 views

Published on

An overview and brief demonstration of Salt, from the LSPE Meetup on 7/19/2012.

http://www.meetup.com/SF-Bay-Area-Large-Scale-Production-Engineering/events/62756562/

Published in: Technology

Sweetening Systems Management with Salt

  1. 1. Sweetening Systems Management with Salt #lspeSF Bay Area Large Scale Production Engineering Meetup "Command and Control" July 19, 2012 Mike Chesnut Principal Systems Administrator, Talksum
  2. 2. What is Salt? http://saltstack.org● Relatively new project (<2 years old)● Started by Thomas Hatch, now ~150 contributors● Written in Python● ZeroMQ as core communication mechanism● Extremely flexible and extensible● Very active community
  3. 3. Key Features Overview Remote Execution Framework● Master(s), Minions● All communications over ZeroMQ ○ PUB-SUB for master->minion ○ REQ-REP for minion->master● All communication encrypted ○ 256-bit AES● Authentication required
  4. 4. Key Features Overview Remote Execution FrameworkConfiguration Management System Highly Modular and ExtensibleReadily Available, Easy to Install API Cloud Provisioning Tool
  5. 5. Salt in Puppet Terms puppet saltLanguage Ruby Python YAML, Python,Configuration Syntax Quasi-Ruby subset Jinja, Mako Extensible/Customizable ActiveMQ (by default),Transport RabbitMQ ZeroMQConfiguration Manifests StatesManagementRemote Execution MCollective Inherent!Variables Facter Grains, Pillar Additional tools to learn, set up, maintain, etc
  6. 6. Salt in Operation Topologies master and minion on same host
  7. 7. Salt in Operation Topologies 1 master, N minions
  8. 8. Salt in Operation TopologiesN masters, N minions
  9. 9. Salt in Operation Topologies● peer-to-peer ○ minions can publish commands/states to each other (via master)● minionswarm for testing ○ spawn 100s or 1000s of minions● multi-master ○ in-product support still lacking ○ users have worked out their own redundancy/failover solutions
  10. 10. Salt in Operation Key Management Minion public keys must beaccepted by the master before communication can occur
  11. 11. Salt in Operation
  12. 12. Salt in Operation
  13. 13. Salt in Operation Remote Execution salt <target> <command> <options>● target - literal ID name, wildcards, PCRE, list, grains● command: ○ >80 modules in standard distribution ○ easy to write your own, of course ○ any command can be run with cmd.run ○ any code can be executed with cmd.exec_code● options are module-specific arguments
  14. 14. Show which grains are defined on a host
  15. 15. Show the values of all grains on a host
  16. 16. See disk space utilization on all database servers
  17. 17. Check status of a particular package on all hosts
  18. 18. See details of all network interfaces on a particular host
  19. 19. Collect MAC addresses from primary interfaces on all web servers
  20. 20. Run an arbitrary shell command on all hosts
  21. 21. Run arbitrary python code on all hosts, specifying which interpreter to use
  22. 22. Salt in Operation State Management● simple syntax, lots of examples available● templatable● several (~25) state classes included in standard distribution● built-in file server also included● states can be invoked individually● recommendation: use source control (e.g. git) for state definition configuration/files!
  23. 23. Applying a single state from the command line
  24. 24. Salt in Operation State ManagementA simple ntpd state:ntp: pkg: - installed service: - name: ntpd - running - watch: - file: /etc/ntp.conf
  25. 25. Salt in Operation State ManagementAdd a templated config file:/etc/ntp.conf: file: - managed - require: - pkg: ntp {% if grains[host] == admin1 %} - source: salt://basics/ntp/ntp-server.conf {% else %} - source: salt://basics/ntp/ntp-client.conf {% endif %}
  26. 26. Applying a single state from an SLS definition
  27. 27. Applying full highstate to all hosts, dry-run (test=true)
  28. 28. Applying full highstate to all hosts, review changes in teal
  29. 29. All states have been fully applied to all systems!
  30. 30. http://saltstack.orghttp://talksum.com

×