blob: 488dac864ab571801ed31a9f6b1f2cb9ae6b4264 [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:
31 master:
32 ...
33 api:
34 enabled: true
35 port: 8000
36
37Salt master with preset minions
38
39.. code-block:: yaml
40
41 salt:
42 master:
43 enabled: true
44 ...
45 minions:
46 - name: 'node1.system.location.domain.com'
47
Adam Tenglercaedd972016-05-04 16:44:00 +020048Salt master with alternative installation source and version (optional) - pip
49
50.. code-block:: yaml
51
52 salt:
53 master:
54 enabled: true
55 ...
56 source:
57 engine: pip
58 version: 2016.3.0rc2
59
Adam Tengler3eb85ad2016-05-06 02:52:40 +020060Salt master with specified formula to install through apt-get
61
62.. code-block:: yaml
63
64 salt:
65 master:
66 enabled: true
67 ...
68 environment:
69 prd:
70 keysone:
71 source: pkg
72 name: salt-formula-keystone
73
74Clone master branch of keystone formula as local feature branch
75
76.. code-block:: yaml
77
78 salt:
79 master:
80 enabled: true
81 ...
82 environment:
83 dev:
84 formula:
85 keystone:
86 source: git
87 address: git@github.com:openstack/salt-formula-keystone.git
88 revision: master
89 branch: feature
90
91Salt master with specified formula refs (for example for Gerrit review)
92
93.. code-block:: yaml
94
95 salt:
96 master:
97 enabled: true
98 ...
99 environment:
100 dev:
101 formula:
102 keystone:
103 source: git
104 address: https://git.openstack.org/openstack/salt-formula-keystone
105 revision: refs/changes/56/123456/1
106
Filip Pytlounb4b80592015-10-06 16:28:32 +0200107Salt master syndicate master of masters
108
109.. code-block:: yaml
110
111 salt:
112 master:
113 enabled: true
114 ...
115 syndic:
116 mode: master
117
118Salt master syndicate (client) master
119
120.. code-block:: yaml
121
122 salt:
123 master:
124 enabled: true
125 ...
126 syndicate:
127 mode: client
128 host: master-master
129
130Salt master with custom handlers
131
132.. code-block:: yaml
133
134 salt:
135 master:
136 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100137 handler:
138 handler01:
139 engine: udp
140 bind:
141 host: 127.0.0.1
142 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +0200143 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100144 handler:
145 handler01:
146 engine: udp
147 bind:
148 host: 127.0.0.1
149 port: 9999
150 handler02:
151 engine: zmq
152 bind:
153 host: 127.0.0.1
154 port: 9999
155
Jakub Pavlikd4859842016-05-23 10:48:04 +0200156Salt master peer for remote certificate sign.
157
158.. code-block:: yaml
159
160 salt:
161 master:
162 peer:
163 ".*":
164 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200165
166Salt minion
167-----------
168
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100169Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200170
171.. code-block:: yaml
172
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100173.. literalinclude:: tests/pillar/minion_master.sls
174 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200175
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100176Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200177
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100178.. literalinclude:: tests/pillar/minion_multi_master.sls
179 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200180
181Salt minion with salt mine options
182
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100183.. literalinclude:: tests/pillar/minion_mine.sls
184 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200185
186Salt minion with graphing dependencies
187
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100188.. literalinclude:: tests/pillar/minion_graph.sls
189 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200190
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200191Salt minion with PKI CA
192
193.. literalinclude:: tests/pillar/minion_pki_ca.sls
194 :language: yaml
195
196Salt minion with PKI certificate
197
198.. literalinclude:: tests/pillar/minion_pki_cert.sls
199 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200200
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100201Salt control (cloud/kvm/docker)
202-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200203
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100204Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200205
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100206.. literalinclude:: tests/pillar/control_cloud_openstack.sls
207 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200208
209Salt cloud with Digital Ocean provider
210
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100211.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
212 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200213
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100214Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200215
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100216.. literalinclude:: tests/pillar/control_virt.sls
217 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200218
Filip Pytlounb4b80592015-10-06 16:28:32 +0200219
220Usage
221=====
222
223Working with salt-cloud
224
225.. code-block:: bash
226
227 salt-cloud -m /path/to/map --assume-yes
228
229Debug LIBCLOUD for salt-cloud connection
230
231.. code-block:: bash
232
233 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
234
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100235
Filip Pytlounb4b80592015-10-06 16:28:32 +0200236Read more
237=========
238
239* http://salt.readthedocs.org/en/latest/
240* https://github.com/DanielBryan/salt-state-graph
241* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
242* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
243* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
244* https://github.com/saltstack-formulas/salt-formula
245* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
246
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100247
Filip Pytlounb4b80592015-10-06 16:28:32 +0200248salt-cloud
249----------
250
251* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
252* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
253* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
254* http://docs.saltstack.com/topics/cloud/digitalocean.html
255* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
256* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
257* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100258
259salt-virt
260---------
smolaona66f7a62016-03-08 21:49:41 +0100261
262Sample pillar
263
264.. code-block:: yaml
265
266 salt:
267 control:
268 enabled: True
269 virt_enabled: True
270 size:
271 medium:
272 cpu: 2
273 ram: 1024
274 cluster:
275 localnode:
276 domain: domain.com
277 engine: virt
278 config:
279 engine: salt
280 host: 127.0.0.1
281 node:
282 ubuntu01:
283 provider: node001.domain.com
284 image: ubuntu-14-04-x64-1456128611.qcow2
285 size: medium
286 disk_profile: database
Adam Tenglercaedd972016-05-04 16:44:00 +0200287 net_profile: testing