blob: 89628cc2aacecfbd5c715185bf69f225fdfc26a0 [file] [log] [blame]
Filip Pytlounb4b80592015-10-06 16:28:32 +02001
Ales Komarek54740682017-05-15 07:16:23 +02002============
3Salt Formula
4============
Filip Pytlounb4b80592015-10-06 16:28:32 +02005
Ales Komarek54740682017-05-15 07:16:23 +02006Salt is a new approach to infrastructure management. Easy enough to get
7running in minutes, scalable enough to manage tens of thousands of servers,
8and fast enough to communicate with them in seconds.
Filip Pytlounb4b80592015-10-06 16:28:32 +02009
Ales Komarek54740682017-05-15 07:16:23 +020010Salt delivers a dynamic communication bus for infrastructures that can be used
11for orchestration, remote execution, configuration management and much more.
Filip Pytlounb4b80592015-10-06 16:28:32 +020012
Ales Komarek54740682017-05-15 07:16:23 +020013
14Sample Metadata
15===============
16
Filip Pytlounb4b80592015-10-06 16:28:32 +020017
18Salt master
19-----------
20
Ales Komarek54740682017-05-15 07:16:23 +020021Salt master with base formulas and pillar metadata backend
Filip Pytlounb4b80592015-10-06 16:28:32 +020022
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010023.. literalinclude:: tests/pillar/master_single_pillar.sls
24 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +020025
Ales Komarek54740682017-05-15 07:16:23 +020026Salt master with reclass ENC metadata backend
Filip Pytlounb4b80592015-10-06 16:28:32 +020027
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010028.. literalinclude:: tests/pillar/master_single_reclass.sls
29 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +020030
31Salt master with API
32
Ales Komarekb2c8ff62016-08-22 00:20:01 +020033.. literalinclude:: tests/pillar/master_api.sls
34 :language: yaml
Ales Komarekcdb280f2016-07-27 15:37:51 +020035
36Salt master with defined user ACLs
37
Ales Komarekb2c8ff62016-08-22 00:20:01 +020038.. literalinclude:: tests/pillar/master_acl.sls
39 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +020040
41Salt master with preset minions
42
43.. code-block:: yaml
44
45 salt:
46 master:
47 enabled: true
Filip Pytlounb4b80592015-10-06 16:28:32 +020048 minions:
49 - name: 'node1.system.location.domain.com'
50
Ales Komarek54740682017-05-15 07:16:23 +020051Salt master with pip based installation (optional)
Adam Tenglercaedd972016-05-04 16:44:00 +020052
53.. code-block:: yaml
54
55 salt:
56 master:
57 enabled: true
58 ...
59 source:
60 engine: pip
61 version: 2016.3.0rc2
62
Ales Komarek54740682017-05-15 07:16:23 +020063Install formula through system package management
Adam Tengler3eb85ad2016-05-06 02:52:40 +020064
65.. code-block:: yaml
66
67 salt:
68 master:
69 enabled: true
70 ...
71 environment:
72 prd:
73 keysone:
74 source: pkg
75 name: salt-formula-keystone
76
77Clone master branch of keystone formula as local feature branch
78
79.. code-block:: yaml
80
81 salt:
82 master:
83 enabled: true
84 ...
85 environment:
86 dev:
87 formula:
88 keystone:
89 source: git
90 address: git@github.com:openstack/salt-formula-keystone.git
91 revision: master
92 branch: feature
93
94Salt master with specified formula refs (for example for Gerrit review)
95
96.. code-block:: yaml
97
98 salt:
99 master:
100 enabled: true
101 ...
102 environment:
103 dev:
104 formula:
105 keystone:
106 source: git
107 address: https://git.openstack.org/openstack/salt-formula-keystone
108 revision: refs/changes/56/123456/1
109
Ales Komarek54740682017-05-15 07:16:23 +0200110Salt master with logging handlers
Filip Pytlounb4b80592015-10-06 16:28:32 +0200111
112.. code-block:: yaml
113
114 salt:
115 master:
116 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100117 handler:
118 handler01:
119 engine: udp
120 bind:
121 host: 127.0.0.1
122 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +0200123 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100124 handler:
125 handler01:
126 engine: udp
127 bind:
128 host: 127.0.0.1
129 port: 9999
130 handler02:
131 engine: zmq
132 bind:
133 host: 127.0.0.1
134 port: 9999
135
Ales Komarek54740682017-05-15 07:16:23 +0200136Salt master peer setup for remote certificate signing
Jakub Pavlikd4859842016-05-23 10:48:04 +0200137
138.. code-block:: yaml
139
140 salt:
141 master:
142 peer:
143 ".*":
144 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200145
Tomáš Kukrál8922aef2017-05-10 10:27:04 +0200146Configure verbosity of state output (used for `salt` command)
147
148.. code-block:: yaml
149
150 salt:
151 master:
Tomáš Kukrál044667b2017-05-11 10:12:15 +0200152 state_output: changes
Tomáš Kukrál8922aef2017-05-10 10:27:04 +0200153
Ales Komarek54740682017-05-15 07:16:23 +0200154Salt Reactor system configuration
155
156.. code-block:: yaml
157
158 salt:
159 master:
160 reactor:
161 salt/minion/*/start:
162 - salt://reactor/minion-started.sls
163
164
165Salt syndic
166-----------
167
168The master of masters
169
170.. code-block:: yaml
171
172 salt:
173 master:
174 enabled: true
175 order_masters: True
176
177Lower syndicated master
178
179.. code-block:: yaml
180
181 salt:
182 syndic:
183 enabled: true
184 master:
185 host: master-of-master-host
186 timeout: 5
187
188Syndicated master with multiple master of masters
189
190.. code-block:: yaml
191
192 salt:
193 syndic:
194 enabled: true
195 masters:
196 - host: master-of-master-host1
197 - host: master-of-master-host2
198 timeout: 5
199
200
201Salt-minion proxy
202-----------------
Jiri Broulika0f46682017-04-20 22:45:01 +0200203
204Salt proxy pillar
205
206.. code-block:: yaml
207
208 salt:
209 minion:
210 proxy:
211 master: localhost
212 device:
213 vsrx01.mydomain.local:
214 enabled: true
215 engine: napalm
216 csr1000v.mydomain.local:
217 enabled: true
218 engine: napalm
219
220.. note:: This is pillar of the the real salt-minion
221
222
223Proxy pillar for IOS device
224
225.. code-block:: yaml
226
227 proxy:
228 proxytype: napalm
229 driver: ios
230 host: csr1000v.mydomain.local
231 username: root
232 passwd: r00tme
233
234.. note:: This is pillar of the node thats not able to run salt-minion itself
235
236
237Proxy pillar for JunOS device
238
239.. code-block:: yaml
240
241 proxy:
242 proxytype: napalm
243 driver: junos
244 host: vsrx01.mydomain.local
245 username: root
246 passwd: r00tme
247 optional_args:
248 config_format: set
249
250.. note:: This is pillar of the node thats not able to run salt-minion itself
251
Ales Komarek8fb1da82016-08-21 23:52:03 +0200252
253Salt SSH
254--------
255
256Salt SSH with sudoer using key
257
258.. literalinclude:: tests/pillar/master_ssh_minion_key.sls
259 :language: yaml
260
261Salt SSH with sudoer using password
262
263.. literalinclude:: tests/pillar/master_ssh_minion_password.sls
264 :language: yaml
265
266Salt SSH with root using password
267
268.. literalinclude:: tests/pillar/master_ssh_minion_root.sls
269 :language: yaml
270
271
Filip Pytlounb4b80592015-10-06 16:28:32 +0200272Salt minion
273-----------
274
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100275Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200276
277.. code-block:: yaml
278
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100279.. literalinclude:: tests/pillar/minion_master.sls
280 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200281
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100282Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200283
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100284.. literalinclude:: tests/pillar/minion_multi_master.sls
285 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200286
287Salt minion with salt mine options
288
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100289.. literalinclude:: tests/pillar/minion_mine.sls
290 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200291
292Salt minion with graphing dependencies
293
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100294.. literalinclude:: tests/pillar/minion_graph.sls
295 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200296
Ales Komarek54740682017-05-15 07:16:23 +0200297Salt minion behind HTTP proxy
Ondrej Smolac2d3e6f2017-03-26 17:52:40 +0200298
299.. code-block:: yaml
300
301 salt:
302 minion:
303 proxy:
304 host: 127.0.0.1
305 port: 3128
306
Ales Komarek54740682017-05-15 07:16:23 +0200307Salt minion with PKI certificate authority (CA)
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200308
309.. literalinclude:: tests/pillar/minion_pki_ca.sls
310 :language: yaml
311
Ales Komarek54740682017-05-15 07:16:23 +0200312Salt minion using PKI certificate
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200313
314.. literalinclude:: tests/pillar/minion_pki_cert.sls
315 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200316
Ales Komarek8fb1da82016-08-21 23:52:03 +0200317
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100318Salt control (cloud/kvm/docker)
319-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200320
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100321Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200322
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100323.. literalinclude:: tests/pillar/control_cloud_openstack.sls
324 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200325
326Salt cloud with Digital Ocean provider
327
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100328.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
329 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200330
Ales Komarek8fb1da82016-08-21 23:52:03 +0200331Salt virt with KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200332
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100333.. literalinclude:: tests/pillar/control_virt.sls
334 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200335
Filip Pytlounb4b80592015-10-06 16:28:32 +0200336
337Usage
338=====
339
340Working with salt-cloud
341
342.. code-block:: bash
343
344 salt-cloud -m /path/to/map --assume-yes
345
346Debug LIBCLOUD for salt-cloud connection
347
348.. code-block:: bash
349
350 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
351
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100352
Ales Komarek54740682017-05-15 07:16:23 +0200353More Information
354================
Filip Pytlounb4b80592015-10-06 16:28:32 +0200355
356* http://salt.readthedocs.org/en/latest/
357* https://github.com/DanielBryan/salt-state-graph
358* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
359* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
360* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
361* https://github.com/saltstack-formulas/salt-formula
362* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
363
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100364
Filip Pytlounb4b80592015-10-06 16:28:32 +0200365salt-cloud
366----------
367
368* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
369* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
370* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
371* http://docs.saltstack.com/topics/cloud/digitalocean.html
372* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
373* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
374* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100375
Filip Pytloun954dbd62017-02-02 13:02:03 +0100376
377Documentation and Bugs
378======================
379
380To learn how to install and update salt-formulas, consult the documentation
381available online at:
382
383 http://salt-formulas.readthedocs.io/
384
385In the unfortunate event that bugs are discovered, they should be reported to
386the appropriate issue tracker. Use Github issue tracker for specific salt
387formula:
388
389 https://github.com/salt-formulas/salt-formula-salt/issues
390
391For feature requests, bug reports or blueprints affecting entire ecosystem,
392use Launchpad salt-formulas project:
393
394 https://launchpad.net/salt-formulas
395
396You can also join salt-formulas-users team and subscribe to mailing list:
397
398 https://launchpad.net/~salt-formulas-users
399
400Developers wishing to work on the salt-formulas projects should always base
401their work on master branch and submit pull request against specific formula.
402
403 https://github.com/salt-formulas/salt-formula-salt
404
405Any questions or feedback is always welcome so feel free to join our IRC
406channel:
407
408 #salt-formulas @ irc.freenode.net