blob: 5ab48b374ff6d06bf50de017b4769409695dae80 [file] [log] [blame]
Filip Pytlounb4b80592015-10-06 16:28:32 +02001
2====
3Salt
4====
5
6Salt is a new approach to infrastructure management. 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.
7
8Salt delivers a dynamic communication bus for infrastructures that can be used for orchestration, remote execution, configuration management and much more.
9
10Sample pillars
11==============
12
13Salt master
14-----------
15
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010016Salt master with base production environment and pillar tree as metadata backend
Filip Pytlounb4b80592015-10-06 16:28:32 +020017
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010018.. literalinclude:: tests/pillar/master_single_pillar.sls
19 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +020020
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010021Salt master with reclass ENC as metadata backend
Filip Pytlounb4b80592015-10-06 16:28:32 +020022
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010023.. literalinclude:: tests/pillar/master_single_reclass.sls
24 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +020025
26Salt master with API
27
28.. code-block:: yaml
29
30 salt:
Filip Pytlounb4b80592015-10-06 16:28:32 +020031 api:
32 enabled: true
Ales Komarekcdb280f2016-07-27 15:37:51 +020033 ssl:
34 engine: salt
35 bind:
36 address: 0.0.0.0
37 port: 8000
38
39Salt master with defined user ACLs
40
41.. code-block:: yaml
42
43 salt:
44 master:
45 user:
46 peter:
47 permissions:
48 - 'fs.fs'
49 - 'fs.\*'
Filip Pytlounb4b80592015-10-06 16:28:32 +020050
51Salt master with preset minions
52
53.. code-block:: yaml
54
55 salt:
56 master:
57 enabled: true
58 ...
59 minions:
60 - name: 'node1.system.location.domain.com'
61
Adam Tenglercaedd972016-05-04 16:44:00 +020062Salt master with alternative installation source and version (optional) - pip
63
64.. code-block:: yaml
65
66 salt:
67 master:
68 enabled: true
69 ...
70 source:
71 engine: pip
72 version: 2016.3.0rc2
73
Adam Tengler3eb85ad2016-05-06 02:52:40 +020074Salt master with specified formula to install through apt-get
75
76.. code-block:: yaml
77
78 salt:
79 master:
80 enabled: true
81 ...
82 environment:
83 prd:
84 keysone:
85 source: pkg
86 name: salt-formula-keystone
87
88Clone master branch of keystone formula as local feature branch
89
90.. code-block:: yaml
91
92 salt:
93 master:
94 enabled: true
95 ...
96 environment:
97 dev:
98 formula:
99 keystone:
100 source: git
101 address: git@github.com:openstack/salt-formula-keystone.git
102 revision: master
103 branch: feature
104
105Salt master with specified formula refs (for example for Gerrit review)
106
107.. code-block:: yaml
108
109 salt:
110 master:
111 enabled: true
112 ...
113 environment:
114 dev:
115 formula:
116 keystone:
117 source: git
118 address: https://git.openstack.org/openstack/salt-formula-keystone
119 revision: refs/changes/56/123456/1
120
Filip Pytlounb4b80592015-10-06 16:28:32 +0200121Salt master syndicate master of masters
122
123.. code-block:: yaml
124
125 salt:
126 master:
127 enabled: true
128 ...
129 syndic:
130 mode: master
131
132Salt master syndicate (client) master
133
134.. code-block:: yaml
135
136 salt:
137 master:
138 enabled: true
139 ...
140 syndicate:
141 mode: client
142 host: master-master
143
144Salt master with custom handlers
145
146.. code-block:: yaml
147
148 salt:
149 master:
150 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100151 handler:
152 handler01:
153 engine: udp
154 bind:
155 host: 127.0.0.1
156 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +0200157 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100158 handler:
159 handler01:
160 engine: udp
161 bind:
162 host: 127.0.0.1
163 port: 9999
164 handler02:
165 engine: zmq
166 bind:
167 host: 127.0.0.1
168 port: 9999
169
Jakub Pavlikd4859842016-05-23 10:48:04 +0200170Salt master peer for remote certificate sign.
171
172.. code-block:: yaml
173
174 salt:
175 master:
176 peer:
177 ".*":
178 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200179
Ales Komarek8fb1da82016-08-21 23:52:03 +0200180
181Salt SSH
182--------
183
184Salt SSH with sudoer using key
185
186.. literalinclude:: tests/pillar/master_ssh_minion_key.sls
187 :language: yaml
188
189Salt SSH with sudoer using password
190
191.. literalinclude:: tests/pillar/master_ssh_minion_password.sls
192 :language: yaml
193
194Salt SSH with root using password
195
196.. literalinclude:: tests/pillar/master_ssh_minion_root.sls
197 :language: yaml
198
199
Filip Pytlounb4b80592015-10-06 16:28:32 +0200200Salt minion
201-----------
202
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100203Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200204
205.. code-block:: yaml
206
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100207.. literalinclude:: tests/pillar/minion_master.sls
208 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200209
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100210Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200211
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100212.. literalinclude:: tests/pillar/minion_multi_master.sls
213 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200214
215Salt minion with salt mine options
216
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100217.. literalinclude:: tests/pillar/minion_mine.sls
218 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200219
220Salt minion with graphing dependencies
221
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100222.. literalinclude:: tests/pillar/minion_graph.sls
223 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200224
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200225Salt minion with PKI CA
226
227.. literalinclude:: tests/pillar/minion_pki_ca.sls
228 :language: yaml
229
230Salt minion with PKI certificate
231
232.. literalinclude:: tests/pillar/minion_pki_cert.sls
233 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200234
Ales Komarek8fb1da82016-08-21 23:52:03 +0200235
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100236Salt control (cloud/kvm/docker)
237-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200238
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100239Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200240
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100241.. literalinclude:: tests/pillar/control_cloud_openstack.sls
242 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200243
244Salt cloud with Digital Ocean provider
245
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100246.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
247 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200248
Ales Komarek8fb1da82016-08-21 23:52:03 +0200249Salt virt with KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200250
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100251.. literalinclude:: tests/pillar/control_virt.sls
252 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200253
Filip Pytlounb4b80592015-10-06 16:28:32 +0200254
255Usage
256=====
257
258Working with salt-cloud
259
260.. code-block:: bash
261
262 salt-cloud -m /path/to/map --assume-yes
263
264Debug LIBCLOUD for salt-cloud connection
265
266.. code-block:: bash
267
268 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
269
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100270
Filip Pytlounb4b80592015-10-06 16:28:32 +0200271Read more
272=========
273
274* http://salt.readthedocs.org/en/latest/
275* https://github.com/DanielBryan/salt-state-graph
276* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
277* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
278* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
279* https://github.com/saltstack-formulas/salt-formula
280* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
281
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100282
Filip Pytlounb4b80592015-10-06 16:28:32 +0200283salt-cloud
284----------
285
286* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
287* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
288* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
289* http://docs.saltstack.com/topics/cloud/digitalocean.html
290* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
291* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
292* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100293