blob: 546129b94153e6f0037f81be418bbe6266e5dc6e [file] [log] [blame]
Filip Pytlounb4b80592015-10-06 16:28:32 +02001
Filip Pytloune3a26ae2016-08-22 14:44:42 +02002====
Filip Pytlounb4b80592015-10-06 16:28:32 +02003Salt
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
Ales Komarekb2c8ff62016-08-22 00:20:01 +020028.. literalinclude:: tests/pillar/master_api.sls
29 :language: yaml
Ales Komarekcdb280f2016-07-27 15:37:51 +020030
31Salt master with defined user ACLs
32
Ales Komarekb2c8ff62016-08-22 00:20:01 +020033.. literalinclude:: tests/pillar/master_acl.sls
34 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +020035
36Salt master with preset minions
37
38.. code-block:: yaml
39
40 salt:
41 master:
42 enabled: true
Filip Pytlounb4b80592015-10-06 16:28:32 +020043 minions:
44 - name: 'node1.system.location.domain.com'
45
Adam Tenglercaedd972016-05-04 16:44:00 +020046Salt master with alternative installation source and version (optional) - pip
47
48.. code-block:: yaml
49
50 salt:
51 master:
52 enabled: true
53 ...
54 source:
55 engine: pip
56 version: 2016.3.0rc2
57
Adam Tengler3eb85ad2016-05-06 02:52:40 +020058Salt master with specified formula to install through apt-get
59
60.. code-block:: yaml
61
62 salt:
63 master:
64 enabled: true
65 ...
66 environment:
67 prd:
68 keysone:
69 source: pkg
70 name: salt-formula-keystone
71
72Clone master branch of keystone formula as local feature branch
73
74.. code-block:: yaml
75
76 salt:
77 master:
78 enabled: true
79 ...
80 environment:
81 dev:
82 formula:
83 keystone:
84 source: git
85 address: git@github.com:openstack/salt-formula-keystone.git
86 revision: master
87 branch: feature
88
89Salt master with specified formula refs (for example for Gerrit review)
90
91.. code-block:: yaml
92
93 salt:
94 master:
95 enabled: true
96 ...
97 environment:
98 dev:
99 formula:
100 keystone:
101 source: git
102 address: https://git.openstack.org/openstack/salt-formula-keystone
103 revision: refs/changes/56/123456/1
104
Ales Komareka33b9052017-01-16 07:10:27 -0800105Salt syndic: Master of masters
Filip Pytlounb4b80592015-10-06 16:28:32 +0200106
107.. code-block:: yaml
108
109 salt:
110 master:
111 enabled: true
Ales Komareka33b9052017-01-16 07:10:27 -0800112 order_masters: True
Filip Pytlounb4b80592015-10-06 16:28:32 +0200113
Ales Komareka33b9052017-01-16 07:10:27 -0800114Salt syndic: Lower master
Filip Pytlounb4b80592015-10-06 16:28:32 +0200115
116.. code-block:: yaml
117
118 salt:
Ales Komareka33b9052017-01-16 07:10:27 -0800119 syndic:
Filip Pytlounb4b80592015-10-06 16:28:32 +0200120 enabled: true
Ales Komareka33b9052017-01-16 07:10:27 -0800121 master:
122 host: master-of-master-host
123 timeout: 5
Filip Pytlounb4b80592015-10-06 16:28:32 +0200124
Ales Komarek2c5e0802017-01-16 07:47:32 -0800125Salt syndic: Lower master with multi-master of masters
126
127.. code-block:: yaml
128
129 salt:
130 syndic:
131 enabled: true
132 masters:
133 - host: master-of-master-host1
134 - host: master-of-master-host2
135 timeout: 5
136
137
Filip Pytlounb4b80592015-10-06 16:28:32 +0200138Salt master with custom handlers
139
140.. code-block:: yaml
141
142 salt:
143 master:
144 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100145 handler:
146 handler01:
147 engine: udp
148 bind:
149 host: 127.0.0.1
150 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +0200151 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100152 handler:
153 handler01:
154 engine: udp
155 bind:
156 host: 127.0.0.1
157 port: 9999
158 handler02:
159 engine: zmq
160 bind:
161 host: 127.0.0.1
162 port: 9999
163
Jakub Pavlikd4859842016-05-23 10:48:04 +0200164Salt master peer for remote certificate sign.
165
166.. code-block:: yaml
167
168 salt:
169 master:
170 peer:
171 ".*":
172 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200173
Jiri Broulika0f46682017-04-20 22:45:01 +0200174Salt proxy
175----------
176
177Salt proxy pillar
178
179.. code-block:: yaml
180
181 salt:
182 minion:
183 proxy:
184 master: localhost
185 device:
186 vsrx01.mydomain.local:
187 enabled: true
188 engine: napalm
189 csr1000v.mydomain.local:
190 enabled: true
191 engine: napalm
192
193.. note:: This is pillar of the the real salt-minion
194
195
196Proxy pillar for IOS device
197
198.. code-block:: yaml
199
200 proxy:
201 proxytype: napalm
202 driver: ios
203 host: csr1000v.mydomain.local
204 username: root
205 passwd: r00tme
206
207.. note:: This is pillar of the node thats not able to run salt-minion itself
208
209
210Proxy pillar for JunOS device
211
212.. code-block:: yaml
213
214 proxy:
215 proxytype: napalm
216 driver: junos
217 host: vsrx01.mydomain.local
218 username: root
219 passwd: r00tme
220 optional_args:
221 config_format: set
222
223.. note:: This is pillar of the node thats not able to run salt-minion itself
224
Ales Komarek8fb1da82016-08-21 23:52:03 +0200225
226Salt SSH
227--------
228
229Salt SSH with sudoer using key
230
231.. literalinclude:: tests/pillar/master_ssh_minion_key.sls
232 :language: yaml
233
234Salt SSH with sudoer using password
235
236.. literalinclude:: tests/pillar/master_ssh_minion_password.sls
237 :language: yaml
238
239Salt SSH with root using password
240
241.. literalinclude:: tests/pillar/master_ssh_minion_root.sls
242 :language: yaml
243
244
Filip Pytlounb4b80592015-10-06 16:28:32 +0200245Salt minion
246-----------
247
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100248Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200249
250.. code-block:: yaml
251
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100252.. literalinclude:: tests/pillar/minion_master.sls
253 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200254
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100255Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200256
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100257.. literalinclude:: tests/pillar/minion_multi_master.sls
258 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200259
260Salt minion with salt mine options
261
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100262.. literalinclude:: tests/pillar/minion_mine.sls
263 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200264
265Salt minion with graphing dependencies
266
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100267.. literalinclude:: tests/pillar/minion_graph.sls
268 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200269
Ondrej Smolac2d3e6f2017-03-26 17:52:40 +0200270Salt minion behind http proxy
271
272.. code-block:: yaml
273
274 salt:
275 minion:
276 proxy:
277 host: 127.0.0.1
278 port: 3128
279
Ales Komarekb2c8ff62016-08-22 00:20:01 +0200280PKI CA
281~~~~~~
282
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200283Salt minion with PKI CA
284
285.. literalinclude:: tests/pillar/minion_pki_ca.sls
286 :language: yaml
287
288Salt minion with PKI certificate
289
290.. literalinclude:: tests/pillar/minion_pki_cert.sls
291 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200292
Ales Komarek8fb1da82016-08-21 23:52:03 +0200293
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100294Salt control (cloud/kvm/docker)
295-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200296
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100297Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200298
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100299.. literalinclude:: tests/pillar/control_cloud_openstack.sls
300 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200301
302Salt cloud with Digital Ocean provider
303
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100304.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
305 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200306
Ales Komarek8fb1da82016-08-21 23:52:03 +0200307Salt virt with KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200308
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100309.. literalinclude:: tests/pillar/control_virt.sls
310 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200311
Filip Pytlounb4b80592015-10-06 16:28:32 +0200312
313Usage
314=====
315
316Working with salt-cloud
317
318.. code-block:: bash
319
320 salt-cloud -m /path/to/map --assume-yes
321
322Debug LIBCLOUD for salt-cloud connection
323
324.. code-block:: bash
325
326 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
327
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100328
Filip Pytlounb4b80592015-10-06 16:28:32 +0200329Read more
330=========
331
332* http://salt.readthedocs.org/en/latest/
333* https://github.com/DanielBryan/salt-state-graph
334* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
335* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
336* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
337* https://github.com/saltstack-formulas/salt-formula
338* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
339
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100340
Filip Pytlounb4b80592015-10-06 16:28:32 +0200341salt-cloud
342----------
343
344* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
345* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
346* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
347* http://docs.saltstack.com/topics/cloud/digitalocean.html
348* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
349* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
350* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100351
Filip Pytloun954dbd62017-02-02 13:02:03 +0100352
353Documentation and Bugs
354======================
355
356To learn how to install and update salt-formulas, consult the documentation
357available online at:
358
359 http://salt-formulas.readthedocs.io/
360
361In the unfortunate event that bugs are discovered, they should be reported to
362the appropriate issue tracker. Use Github issue tracker for specific salt
363formula:
364
365 https://github.com/salt-formulas/salt-formula-salt/issues
366
367For feature requests, bug reports or blueprints affecting entire ecosystem,
368use Launchpad salt-formulas project:
369
370 https://launchpad.net/salt-formulas
371
372You can also join salt-formulas-users team and subscribe to mailing list:
373
374 https://launchpad.net/~salt-formulas-users
375
376Developers wishing to work on the salt-formulas projects should always base
377their work on master branch and submit pull request against specific formula.
378
379 https://github.com/salt-formulas/salt-formula-salt
380
381Any questions or feedback is always welcome so feel free to join our IRC
382channel:
383
384 #salt-formulas @ irc.freenode.net