blob: ee38b3449fcd0e14716117275a323dc7628e5b5f [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
Filip Pytlounb4b80592015-10-06 16:28:32 +0200123
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100124Salt control (cloud/kvm/docker)
125-------------------------------
Filip Pytlounb4b80592015-10-06 16:28:32 +0200126
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100127Salt cloud with local OpenStack provider
Filip Pytlounb4b80592015-10-06 16:28:32 +0200128
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100129.. literalinclude:: tests/pillar/control_cloud_openstack.sls
130 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200131
132Salt cloud with Digital Ocean provider
133
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100134.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls
135 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200136
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100137Salt virt KVM cluster
Filip Pytlounb4b80592015-10-06 16:28:32 +0200138
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100139.. literalinclude:: tests/pillar/control_virt.sls
140 :language: yaml
Filip Pytlounb4b80592015-10-06 16:28:32 +0200141
Filip Pytlounb4b80592015-10-06 16:28:32 +0200142
143Usage
144=====
145
146Working with salt-cloud
147
148.. code-block:: bash
149
150 salt-cloud -m /path/to/map --assume-yes
151
152Debug LIBCLOUD for salt-cloud connection
153
154.. code-block:: bash
155
156 export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all
157
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100158
Filip Pytlounb4b80592015-10-06 16:28:32 +0200159Read more
160=========
161
162* http://salt.readthedocs.org/en/latest/
163* https://github.com/DanielBryan/salt-state-graph
164* http://karlgrz.com/testing-salt-states-rapidly-with-docker/
165* https://mywushublog.com/2013/03/configuration-management-with-salt-stack/
166* http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/
167* https://github.com/saltstack-formulas/salt-formula
168* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
169
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100170
Filip Pytlounb4b80592015-10-06 16:28:32 +0200171salt-cloud
172----------
173
174* http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html
175* http://cloudinit.readthedocs.org/en/latest/topics/examples.html
176* http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html
177* http://docs.saltstack.com/topics/cloud/digitalocean.html
178* http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html
179* http://salt-cloud.readthedocs.org/en/latest/topics/map.html
180* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html
Ales Komarek8ba9c0b2016-02-21 14:59:59 +0100181
182salt-virt
183---------
smolaona66f7a62016-03-08 21:49:41 +0100184
185Sample pillar
186
187.. code-block:: yaml
188
189 salt:
190 control:
191 enabled: True
192 virt_enabled: True
193 size:
194 medium:
195 cpu: 2
196 ram: 1024
197 cluster:
198 localnode:
199 domain: domain.com
200 engine: virt
201 config:
202 engine: salt
203 host: 127.0.0.1
204 node:
205 ubuntu01:
206 provider: node001.domain.com
207 image: ubuntu-14-04-x64-1456128611.qcow2
208 size: medium
209 disk_profile: database
210 net_profile: testing