blob: dd87f5344e72ddcdc1e980a88d38cca50b0fd3e4 [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
Filip Pytlounb4b80592015-10-06 16:28:32 +0200156
157Salt minion
158-----------
159
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100160Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200161
162.. code-block:: yaml
163
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100164.. literalinclude:: tests/pillar/minion_master.sls
165 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200166
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100167Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200168
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100169.. literalinclude:: tests/pillar/minion_multi_master.sls
170 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200171
172Salt minion with salt mine options
173
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100174.. literalinclude:: tests/pillar/minion_mine.sls
175 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200176
177Salt minion with graphing dependencies
178
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100179.. literalinclude:: tests/pillar/minion_graph.sls
180 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200181
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200182Salt minion with PKI CA
183
184.. literalinclude:: tests/pillar/minion_pki_ca.sls
185 :language: yaml
186
187Salt minion with PKI certificate
188
189.. literalinclude:: tests/pillar/minion_pki_cert.sls
190 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200191
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100192Salt control (cloud/kvm/docker)
193-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200194
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100195Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200196
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100197.. literalinclude:: tests/pillar/control_cloud_openstack.sls
198 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200199
200Salt cloud with Digital Ocean provider
201
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100202.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
203 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200204
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100205Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200206
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100207.. literalinclude:: tests/pillar/control_virt.sls
208 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200209
Filip Pytlounb4b80592015-10-06 16:28:32 +0200210
211Usage
212=====
213
214Working with salt-cloud
215
216.. code-block:: bash
217
218 salt-cloud -m /path/to/map --assume-yes
219
220Debug LIBCLOUD for salt-cloud connection
221
222.. code-block:: bash
223
224 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
225
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100226
Filip Pytlounb4b80592015-10-06 16:28:32 +0200227Read more
228=========
229
230* http://salt.readthedocs.org/en/latest/
231* https://github.com/DanielBryan/salt-state-graph
232* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
233* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
234* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
235* https://github.com/saltstack-formulas/salt-formula
236* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
237
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100238
Filip Pytlounb4b80592015-10-06 16:28:32 +0200239salt-cloud
240----------
241
242* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
243* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
244* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
245* http://docs.saltstack.com/topics/cloud/digitalocean.html
246* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
247* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
248* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100249
250salt-virt
251---------
smolaona66f7a62016-03-08 21:49:41 +0100252
253Sample pillar
254
255.. code-block:: yaml
256
257 salt:
258 control:
259 enabled: True
260 virt_enabled: True
261 size:
262 medium:
263 cpu: 2
264 ram: 1024
265 cluster:
266 localnode:
267 domain: domain.com
268 engine: virt
269 config:
270 engine: salt
271 host: 127.0.0.1
272 node:
273 ubuntu01:
274 provider: node001.domain.com
275 image: ubuntu-14-04-x64-1456128611.qcow2
276 size: medium
277 disk_profile: database
Adam Tenglercaedd972016-05-04 16:44:00 +0200278 net_profile: testing