blob: f63aa65863dbed3e0fe5897af3baff676596f6e9 [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
Filip Pytlounb4b80592015-10-06 16:28:32 +0200109
110Salt minion
111-----------
112
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100113Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200114
115.. code-block:: yaml
116
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100117.. literalinclude:: tests/pillar/minion_master.sls
118 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200119
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100120Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200121
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100122.. literalinclude:: tests/pillar/minion_multi_master.sls
123 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200124
125Salt minion with salt mine options
126
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100127.. literalinclude:: tests/pillar/minion_mine.sls
128 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200129
130Salt minion with graphing dependencies
131
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100132.. literalinclude:: tests/pillar/minion_graph.sls
133 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200134
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200135Salt minion with PKI CA
136
137.. literalinclude:: tests/pillar/minion_pki_ca.sls
138 :language: yaml
139
140Salt minion with PKI certificate
141
142.. literalinclude:: tests/pillar/minion_pki_cert.sls
143 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200144
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100145Salt control (cloud/kvm/docker)
146-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200147
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100148Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200149
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100150.. literalinclude:: tests/pillar/control_cloud_openstack.sls
151 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200152
153Salt cloud with Digital Ocean provider
154
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100155.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
156 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200157
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100158Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200159
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100160.. literalinclude:: tests/pillar/control_virt.sls
161 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200162
Filip Pytlounb4b80592015-10-06 16:28:32 +0200163
164Usage
165=====
166
167Working with salt-cloud
168
169.. code-block:: bash
170
171 salt-cloud -m /path/to/map --assume-yes
172
173Debug LIBCLOUD for salt-cloud connection
174
175.. code-block:: bash
176
177 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
178
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100179
Filip Pytlounb4b80592015-10-06 16:28:32 +0200180Read more
181=========
182
183* http://salt.readthedocs.org/en/latest/
184* https://github.com/DanielBryan/salt-state-graph
185* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
186* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
187* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
188* https://github.com/saltstack-formulas/salt-formula
189* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
190
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100191
Filip Pytlounb4b80592015-10-06 16:28:32 +0200192salt-cloud
193----------
194
195* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
196* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
197* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
198* http://docs.saltstack.com/topics/cloud/digitalocean.html
199* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
200* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
201* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100202
203salt-virt
204---------
smolaona66f7a62016-03-08 21:49:41 +0100205
206Sample pillar
207
208.. code-block:: yaml
209
210 salt:
211 control:
212 enabled: True
213 virt_enabled: True
214 size:
215 medium:
216 cpu: 2
217 ram: 1024
218 cluster:
219 localnode:
220 domain: domain.com
221 engine: virt
222 config:
223 engine: salt
224 host: 127.0.0.1
225 node:
226 ubuntu01:
227 provider: node001.domain.com
228 image: ubuntu-14-04-x64-1456128611.qcow2
229 size: medium
230 disk_profile: database
Adam Tenglercaedd972016-05-04 16:44:00 +0200231 net_profile: testing