blob: c079750a76eef86a16f13cb7d3c572d5147b3861 [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
Filip Pytlounb4b80592015-10-06 16:28:32 +0200105Salt master syndicate master of masters
106
107.. code-block:: yaml
108
109 salt:
110 master:
111 enabled: true
Ales Komarekb2c8ff62016-08-22 00:20:01 +0200112 syndicate:
Filip Pytlounb4b80592015-10-06 16:28:32 +0200113 mode: master
114
115Salt master syndicate (client) master
116
117.. code-block:: yaml
118
119 salt:
120 master:
121 enabled: true
Filip Pytlounb4b80592015-10-06 16:28:32 +0200122 syndicate:
123 mode: client
124 host: master-master
125
126Salt master with custom handlers
127
128.. code-block:: yaml
129
130 salt:
131 master:
132 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100133 handler:
134 handler01:
135 engine: udp
136 bind:
137 host: 127.0.0.1
138 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +0200139 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100140 handler:
141 handler01:
142 engine: udp
143 bind:
144 host: 127.0.0.1
145 port: 9999
146 handler02:
147 engine: zmq
148 bind:
149 host: 127.0.0.1
150 port: 9999
151
Jakub Pavlikd4859842016-05-23 10:48:04 +0200152Salt master peer for remote certificate sign.
153
154.. code-block:: yaml
155
156 salt:
157 master:
158 peer:
159 ".*":
160 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200161
Ales Komarek8fb1da82016-08-21 23:52:03 +0200162
163Salt SSH
164--------
165
166Salt SSH with sudoer using key
167
168.. literalinclude:: tests/pillar/master_ssh_minion_key.sls
169 :language: yaml
170
171Salt SSH with sudoer using password
172
173.. literalinclude:: tests/pillar/master_ssh_minion_password.sls
174 :language: yaml
175
176Salt SSH with root using password
177
178.. literalinclude:: tests/pillar/master_ssh_minion_root.sls
179 :language: yaml
180
181
Filip Pytlounb4b80592015-10-06 16:28:32 +0200182Salt minion
183-----------
184
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100185Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200186
187.. code-block:: yaml
188
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100189.. literalinclude:: tests/pillar/minion_master.sls
190 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200191
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100192Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200193
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100194.. literalinclude:: tests/pillar/minion_multi_master.sls
195 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200196
197Salt minion with salt mine options
198
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100199.. literalinclude:: tests/pillar/minion_mine.sls
200 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200201
202Salt minion with graphing dependencies
203
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100204.. literalinclude:: tests/pillar/minion_graph.sls
205 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200206
Ales Komarekb2c8ff62016-08-22 00:20:01 +0200207PKI CA
208~~~~~~
209
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200210Salt minion with PKI CA
211
212.. literalinclude:: tests/pillar/minion_pki_ca.sls
213 :language: yaml
214
215Salt minion with PKI certificate
216
217.. literalinclude:: tests/pillar/minion_pki_cert.sls
218 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200219
Ales Komarek8fb1da82016-08-21 23:52:03 +0200220
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100221Salt control (cloud/kvm/docker)
222-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200223
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100224Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200225
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100226.. literalinclude:: tests/pillar/control_cloud_openstack.sls
227 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200228
229Salt cloud with Digital Ocean provider
230
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100231.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
232 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200233
Ales Komarek8fb1da82016-08-21 23:52:03 +0200234Salt virt with KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200235
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100236.. literalinclude:: tests/pillar/control_virt.sls
237 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200238
Filip Pytlounb4b80592015-10-06 16:28:32 +0200239
240Usage
241=====
242
243Working with salt-cloud
244
245.. code-block:: bash
246
247 salt-cloud -m /path/to/map --assume-yes
248
249Debug LIBCLOUD for salt-cloud connection
250
251.. code-block:: bash
252
253 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
254
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100255
Filip Pytlounb4b80592015-10-06 16:28:32 +0200256Read more
257=========
258
259* http://salt.readthedocs.org/en/latest/
260* https://github.com/DanielBryan/salt-state-graph
261* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
262* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
263* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
264* https://github.com/saltstack-formulas/salt-formula
265* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
266
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100267
Filip Pytlounb4b80592015-10-06 16:28:32 +0200268salt-cloud
269----------
270
271* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
272* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
273* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
274* http://docs.saltstack.com/topics/cloud/digitalocean.html
275* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
276* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
277* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100278