blob: ec4f666534e6280ce44350df35c3005c0176b242 [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
48Salt master syndicate master of masters
49
50.. code-block:: yaml
51
52 salt:
53 master:
54 enabled: true
55 ...
56 syndic:
57 mode: master
58
59Salt master syndicate (client) master
60
61.. code-block:: yaml
62
63 salt:
64 master:
65 enabled: true
66 ...
67 syndicate:
68 mode: client
69 host: master-master
70
71Salt master with custom handlers
72
73.. code-block:: yaml
74
75 salt:
76 master:
77 enabled: true
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010078 handler:
79 handler01:
80 engine: udp
81 bind:
82 host: 127.0.0.1
83 port: 9999
Filip Pytlounb4b80592015-10-06 16:28:32 +020084 minion:
Ales Komarek8ba9c0b2016-02-21 14:59:59 +010085 handler:
86 handler01:
87 engine: udp
88 bind:
89 host: 127.0.0.1
90 port: 9999
91 handler02:
92 engine: zmq
93 bind:
94 host: 127.0.0.1
95 port: 9999
96
Filip Pytlounb4b80592015-10-06 16:28:32 +020097
98Salt minion
99-----------
100
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100101Simplest Salt minion setup with central configuration node
Filip Pytlounb4b80592015-10-06 16:28:32 +0200102
103.. code-block:: yaml
104
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100105.. literalinclude:: tests/pillar/minion_master.sls
106 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200107
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100108Multi-master Salt minion setup
Filip Pytlounb4b80592015-10-06 16:28:32 +0200109
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100110.. literalinclude:: tests/pillar/minion_multi_master.sls
111 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200112
113Salt minion with salt mine options
114
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100115.. literalinclude:: tests/pillar/minion_mine.sls
116 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200117
118Salt minion with graphing dependencies
119
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100120.. literalinclude:: tests/pillar/minion_graph.sls
121 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200122
Ales Komarek5d17e4b2016-04-08 11:53:53 +0200123Salt minion with PKI CA
124
125.. literalinclude:: tests/pillar/minion_pki_ca.sls
126 :language: yaml
127
128Salt minion with PKI certificate
129
130.. literalinclude:: tests/pillar/minion_pki_cert.sls
131 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200132
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100133Salt control (cloud/kvm/docker)
134-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200135
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100136Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200137
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100138.. literalinclude:: tests/pillar/control_cloud_openstack.sls
139 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200140
141Salt cloud with Digital Ocean provider
142
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100143.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
144 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200145
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100146Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200147
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100148.. literalinclude:: tests/pillar/control_virt.sls
149 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200150
Filip Pytlounb4b80592015-10-06 16:28:32 +0200151
152Usage
153=====
154
155Working with salt-cloud
156
157.. code-block:: bash
158
159 salt-cloud -m /path/to/map --assume-yes
160
161Debug LIBCLOUD for salt-cloud connection
162
163.. code-block:: bash
164
165 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
166
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100167
Filip Pytlounb4b80592015-10-06 16:28:32 +0200168Read more
169=========
170
171* http://salt.readthedocs.org/en/latest/
172* https://github.com/DanielBryan/salt-state-graph
173* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
174* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
175* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
176* https://github.com/saltstack-formulas/salt-formula
177* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
178
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100179
Filip Pytlounb4b80592015-10-06 16:28:32 +0200180salt-cloud
181----------
182
183* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
184* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
185* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
186* http://docs.saltstack.com/topics/cloud/digitalocean.html
187* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
188* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
189* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100190
191salt-virt
192---------
smolaona66f7a62016-03-08 21:49:41 +0100193
194Sample pillar
195
196.. code-block:: yaml
197
198 salt:
199 control:
200 enabled: True
201 virt_enabled: True
202 size:
203 medium:
204 cpu: 2
205 ram: 1024
206 cluster:
207 localnode:
208 domain: domain.com
209 engine: virt
210 config:
211 engine: salt
212 host: 127.0.0.1
213 node:
214 ubuntu01:
215 provider: node001.domain.com
216 image: ubuntu-14-04-x64-1456128611.qcow2
217 size: medium
218 disk_profile: database
219 net_profile: testing