Presented by Justin Carmony / @JustinCarmony
Slides split up into multiple sections.
Slides both vertical and horizontal.
Problem: It's Easy!
Problem: Lack of Ops Experience
Problem: Lack of Money
We've been putting more dev into ops, but we need to put more ops into dev. Ops is a state of mind. Theo Schlossnagle
CEO, OmniTI
SaltStack takes a new approach to infrastructure management by developing software that is easy enough to get running in minutes, scalable enough to manage tens of thousands of servers, and fast enough to communicate with them in seconds. SaltStack delivers a dynamic infrastructure communication bus used for orchestration, remote execution, configuration management and much more. About SaltStack, SaltStack.org
Salt is a simple system that focuses on two things:
file_roots:
base:
- /srv/salt
pillar_roots:
base:
- /srv/pillar
master: master.saltdemo.com
pillar_roots:
base:
- /srv/pillar
On the salt master, list the current keys
user@salt-master:~$ sudo salt-key -L
Accepted Keys:
Unaccepted Keys:
web1.salt-demo.com
Rejected Keys:
Accept the key (view it before hand to make sure it's legit)
user@salt-master:~$ sudo salt-key -a web1.salt-demo.com
Accepted Keys:
web1.salt-demo.com
Unaccepted Keys:
Rejected Keys:
Use "salt" command on master to communicate to minions
Example: Test Ping to All Minions
user@salt-master:~$ sudo salt '*' test.ping
web1.saltdemo.com:
True
salt 'db*' test.ping
salt -L web1.saltdemo.com,db2.saltdemo.com test.ping
salt -G 'os:Ubuntu' test.ping
salt -C 'G@os:Debian and web*' test.ping
Example: Restart Apache
user@master:~$ sudo salt 'web*' cmd.run "/etc/init.d/apache2 restart"
Example: Restart Apache
user@salt-master:~$ sudo salt 'web*' apache.signal restart
Here are just some of them:
apache, apt, cron, disk, file, mount, mysql, network, puppet, service, solr, state, test, useradd, win_disk, win_service, win_useradd
Example using English:
Defines which servers have which parts of the state tree applied to them.
Example top.sls file:
base:
'*':
- core.tools
- core.users
'web1.saltdemo.com':
- apache2
- php5
base:
'*':
# Stuff for all servers
dev:
'*':
# stuff for dev stage
stage:
'*':
# stuff for stable stage
prod:
'*':
# stuff for prod stage
Base is your file_roots
Example of a user definition
justin: ## ID
user: ## Type
- present ## Function
- shell: /bin/bash
- home: /home/justin
- password: $1$MG4PbsH9$.w68M3yd/kUmESwq3cRM91
apache2:
pkg:
- installed
service:
- running
/etc/apache2/apache2.conf:
file:
- managed
- source: salt://files/etc/apache2/apache2.conf
- watch_in:
- service: apache2
apache:
pkg.installed:
{% if grains['os'] == 'RedHat' %}
- name: httpd
{% elif grains['os'] == 'Ubuntu' %}
- name: apache2
{% endif %}
You just call the state.highstate function
salt '*' state.highstate
Run things in the foreground:
# Run master in foreground
/etc/init.d/salt-master stop
salt-master -L
# Run minion in foreground
/etc/init.d/salt-minion stop
salt-minion -L
Run things manualy from the minion
salt-call -l debug state.highstate
python -c 'import socket;print(socket.getfqdn());'
https://github.com/JustinCarmonyDotCom/salt-demo
Uses Vagrant & AWS to setup a test 5 server environment.
Salt has some very good docs (and getting better all the time).
irc.freenode.net #salt
Blog/tweet/discuss your experience
Very Pull Request friendly
(They even have accepted PR's from me!)