blob: 0c4df3056a74896d2ba10a3881fcbf9ddbee956c [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
Filip Pytlounb4b80592015-10-06 16:28:32 +020060Salt master syndicate master of masters
61
62.. code-block:: yaml
63
64 salt:
65 master:
66 enabled: true
67 ...
68 syndic:
69 mode: master
70
71Salt master syndicate (client) master
72
73.. code-block:: yaml
74
75 salt:
76 master:
77 enabled: true
78 ...
79 syndicate:
80 mode: client
81 host: master-master
82
83Salt master with custom handlers
84
85.. code-block:: yaml
86
87 salt:
88 master:
89 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010090 handler:
91 handler01:
92 engine: udp
93 bind:
94 host: 127.0.0.1
95 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +020096 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010097 handler:
98 handler01:
99 engine: udp
100 bind:
101 host: 127.0.0.1
102 port: 9999
103 handler02:
104 engine: zmq
105 bind:
106 host: 127.0.0.1
107 port: 9999
108
Jakub Pavlikd4859842016-05-23 10:48:04 +0200109Salt master peer for remote certificate sign.
110
111.. code-block:: yaml
112
113 salt:
114 master:
115 peer:
116 ".*":
117 - x509.sign_remote_certificate
Filip Pytlounb4b80592015-10-06 16:28:32 +0200118
119Salt minion
120-----------
121
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100122Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200123
124.. code-block:: yaml
125
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100126.. literalinclude:: tests/pillar/minion_master.sls
127 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200128
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100129Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200130
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100131.. literalinclude:: tests/pillar/minion_multi_master.sls
132 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200133
134Salt minion with salt mine options
135
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100136.. literalinclude:: tests/pillar/minion_mine.sls
137 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200138
139Salt minion with graphing dependencies
140
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100141.. literalinclude:: tests/pillar/minion_graph.sls
142 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200143
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200144Salt minion with PKI CA
145
146.. literalinclude:: tests/pillar/minion_pki_ca.sls
147 :language: yaml
148
149Salt minion with PKI certificate
150
151.. literalinclude:: tests/pillar/minion_pki_cert.sls
152 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200153
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100154Salt control (cloud/kvm/docker)
155-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200156
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100157Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200158
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100159.. literalinclude:: tests/pillar/control_cloud_openstack.sls
160 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200161
162Salt cloud with Digital Ocean provider
163
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100164.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
165 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200166
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100167Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200168
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100169.. literalinclude:: tests/pillar/control_virt.sls
170 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200171
Filip Pytlounb4b80592015-10-06 16:28:32 +0200172
173Usage
174=====
175
176Working with salt-cloud
177
178.. code-block:: bash
179
180 salt-cloud -m /path/to/map --assume-yes
181
182Debug LIBCLOUD for salt-cloud connection
183
184.. code-block:: bash
185
186 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
187
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100188
Filip Pytlounb4b80592015-10-06 16:28:32 +0200189Read more
190=========
191
192* http://salt.readthedocs.org/en/latest/
193* https://github.com/DanielBryan/salt-state-graph
194* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
195* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
196* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
197* https://github.com/saltstack-formulas/salt-formula
198* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
199
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100200
Filip Pytlounb4b80592015-10-06 16:28:32 +0200201salt-cloud
202----------
203
204* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
205* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
206* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
207* http://docs.saltstack.com/topics/cloud/digitalocean.html
208* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
209* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
210* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100211
212salt-virt
213---------
smolaona66f7a62016-03-08 21:49:41 +0100214
215Sample pillar
216
217.. code-block:: yaml
218
219 salt:
220 control:
221 enabled: True
222 virt_enabled: True
223 size:
224 medium:
225 cpu: 2
226 ram: 1024
227 cluster:
228 localnode:
229 domain: domain.com
230 engine: virt
231 config:
232 engine: salt
233 host: 127.0.0.1
234 node:
235 ubuntu01:
236 provider: node001.domain.com
237 image: ubuntu-14-04-x64-1456128611.qcow2
238 size: medium
239 disk_profile: database
Adam Tenglercaedd972016-05-04 16:44:00 +0200240 net_profile: testing