blob: 7efa94cc616e766c4823bc6047c50eee5e7b7d3a [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
125Salt master with custom handlers
126
127.. code-block:: yaml
128
129 salt:
130 master:
131 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100132 handler:
133 handler01:
134 engine: udp
135 bind:
136 host: 127.0.0.1
137 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +0200138 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100139 handler:
140 handler01:
141 engine: udp
142 bind:
143 host: 127.0.0.1
144 port: 9999
145 handler02:
146 engine: zmq
147 bind:
148 host: 127.0.0.1
149 port: 9999
150
Jakub Pavlikd4859842016-05-23 10:48:04 +0200151Salt master peer for remote certificate sign.
152
153.. code-block:: yaml
154
155 salt:
156 master:
157 peer:
158 ".*":
159 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200160
Ales Komarek8fb1da82016-08-21 23:52:03 +0200161
162Salt SSH
163--------
164
165Salt SSH with sudoer using key
166
167.. literalinclude:: tests/pillar/master_ssh_minion_key.sls
168 :language: yaml
169
170Salt SSH with sudoer using password
171
172.. literalinclude:: tests/pillar/master_ssh_minion_password.sls
173 :language: yaml
174
175Salt SSH with root using password
176
177.. literalinclude:: tests/pillar/master_ssh_minion_root.sls
178 :language: yaml
179
180
Filip Pytlounb4b80592015-10-06 16:28:32 +0200181Salt minion
182-----------
183
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100184Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200185
186.. code-block:: yaml
187
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100188.. literalinclude:: tests/pillar/minion_master.sls
189 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200190
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100191Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200192
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100193.. literalinclude:: tests/pillar/minion_multi_master.sls
194 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200195
196Salt minion with salt mine options
197
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100198.. literalinclude:: tests/pillar/minion_mine.sls
199 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200200
201Salt minion with graphing dependencies
202
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100203.. literalinclude:: tests/pillar/minion_graph.sls
204 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200205
Ales Komarekb2c8ff62016-08-22 00:20:01 +0200206PKI CA
207~~~~~~
208
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200209Salt minion with PKI CA
210
211.. literalinclude:: tests/pillar/minion_pki_ca.sls
212 :language: yaml
213
214Salt minion with PKI certificate
215
216.. literalinclude:: tests/pillar/minion_pki_cert.sls
217 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200218
Ales Komarek8fb1da82016-08-21 23:52:03 +0200219
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100220Salt control (cloud/kvm/docker)
221-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200222
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100223Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200224
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100225.. literalinclude:: tests/pillar/control_cloud_openstack.sls
226 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200227
228Salt cloud with Digital Ocean provider
229
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100230.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
231 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200232
Ales Komarek8fb1da82016-08-21 23:52:03 +0200233Salt virt with KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200234
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100235.. literalinclude:: tests/pillar/control_virt.sls
236 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200237
Filip Pytlounb4b80592015-10-06 16:28:32 +0200238
239Usage
240=====
241
242Working with salt-cloud
243
244.. code-block:: bash
245
246 salt-cloud -m /path/to/map --assume-yes
247
248Debug LIBCLOUD for salt-cloud connection
249
250.. code-block:: bash
251
252 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
253
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100254
Filip Pytlounb4b80592015-10-06 16:28:32 +0200255Read more
256=========
257
258* http://salt.readthedocs.org/en/latest/
259* https://github.com/DanielBryan/salt-state-graph
260* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
261* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
262* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
263* https://github.com/saltstack-formulas/salt-formula
264* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
265
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100266
Filip Pytlounb4b80592015-10-06 16:28:32 +0200267salt-cloud
268----------
269
270* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
271* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
272* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
273* http://docs.saltstack.com/topics/cloud/digitalocean.html
274* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
275* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
276* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100277