blob: a46f85b751e905126b5e78bbbebc8e40cfc7bd09 [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
180Salt minion
181-----------
182
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100183Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200184
185.. code-block:: yaml
186
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100187.. literalinclude:: tests/pillar/minion_master.sls
188 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200189
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100190Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200191
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100192.. literalinclude:: tests/pillar/minion_multi_master.sls
193 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200194
195Salt minion with salt mine options
196
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100197.. literalinclude:: tests/pillar/minion_mine.sls
198 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200199
200Salt minion with graphing dependencies
201
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100202.. literalinclude:: tests/pillar/minion_graph.sls
203 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200204
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200205Salt minion with PKI CA
206
207.. literalinclude:: tests/pillar/minion_pki_ca.sls
208 :language: yaml
209
210Salt minion with PKI certificate
211
212.. literalinclude:: tests/pillar/minion_pki_cert.sls
213 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200214
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100215Salt control (cloud/kvm/docker)
216-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200217
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100218Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200219
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100220.. literalinclude:: tests/pillar/control_cloud_openstack.sls
221 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200222
223Salt cloud with Digital Ocean provider
224
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100225.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
226 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200227
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100228Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200229
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100230.. literalinclude:: tests/pillar/control_virt.sls
231 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200232
Filip Pytlounb4b80592015-10-06 16:28:32 +0200233
234Usage
235=====
236
237Working with salt-cloud
238
239.. code-block:: bash
240
241 salt-cloud -m /path/to/map --assume-yes
242
243Debug LIBCLOUD for salt-cloud connection
244
245.. code-block:: bash
246
247 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
248
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100249
Filip Pytlounb4b80592015-10-06 16:28:32 +0200250Read more
251=========
252
253* http://salt.readthedocs.org/en/latest/
254* https://github.com/DanielBryan/salt-state-graph
255* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
256* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
257* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
258* https://github.com/saltstack-formulas/salt-formula
259* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
260
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100261
Filip Pytlounb4b80592015-10-06 16:28:32 +0200262salt-cloud
263----------
264
265* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
266* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
267* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
268* http://docs.saltstack.com/topics/cloud/digitalocean.html
269* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
270* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
271* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100272
273salt-virt
274---------
smolaona66f7a62016-03-08 21:49:41 +0100275
276Sample pillar
277
278.. code-block:: yaml
279
280 salt:
281 control:
282 enabled: True
283 virt_enabled: True
284 size:
285 medium:
286 cpu: 2
287 ram: 1024
288 cluster:
289 localnode:
290 domain: domain.com
291 engine: virt
292 config:
293 engine: salt
294 host: 127.0.0.1
295 node:
296 ubuntu01:
297 provider: node001.domain.com
298 image: ubuntu-14-04-x64-1456128611.qcow2
299 size: medium
300 disk_profile: database
Adam Tenglercaedd972016-05-04 16:44:00 +0200301 net_profile: testing