Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 2 | ============ |
| 3 | Salt Formula |
| 4 | ============ |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 5 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 6 | Salt is a new approach to infrastructure management. Easy enough to get |
| 7 | running in minutes, scalable enough to manage tens of thousands of servers, |
| 8 | and fast enough to communicate with them in seconds. |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 9 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 10 | Salt delivers a dynamic communication bus for infrastructures that can be used |
| 11 | for orchestration, remote execution, configuration management and much more. |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 12 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 13 | |
| 14 | Sample Metadata |
| 15 | =============== |
| 16 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 17 | |
| 18 | Salt master |
| 19 | ----------- |
| 20 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 21 | Salt master with base formulas and pillar metadata backend |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 22 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 23 | .. literalinclude:: tests/pillar/master_single_pillar.sls |
| 24 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 25 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 26 | Salt master with reclass ENC metadata backend |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 27 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 28 | .. literalinclude:: tests/pillar/master_single_reclass.sls |
| 29 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 30 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 31 | Salt master with multiple ext_pillars |
| 32 | |
| 33 | .. literalinclude:: tests/pillar/master_single_extpillars.sls |
| 34 | :language: yaml |
| 35 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 36 | Salt master with API |
| 37 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 38 | .. literalinclude:: tests/pillar/master_api.sls |
| 39 | :language: yaml |
Ales Komarek | cdb280f | 2016-07-27 15:37:51 +0200 | [diff] [blame] | 40 | |
| 41 | Salt master with defined user ACLs |
| 42 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 43 | .. literalinclude:: tests/pillar/master_acl.sls |
| 44 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 45 | |
| 46 | Salt master with preset minions |
| 47 | |
| 48 | .. code-block:: yaml |
| 49 | |
| 50 | salt: |
| 51 | master: |
| 52 | enabled: true |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 53 | minions: |
| 54 | - name: 'node1.system.location.domain.com' |
| 55 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 56 | Salt master with pip based installation (optional) |
Adam Tengler | caedd97 | 2016-05-04 16:44:00 +0200 | [diff] [blame] | 57 | |
| 58 | .. code-block:: yaml |
| 59 | |
| 60 | salt: |
| 61 | master: |
| 62 | enabled: true |
| 63 | ... |
| 64 | source: |
| 65 | engine: pip |
| 66 | version: 2016.3.0rc2 |
| 67 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 68 | Install formula through system package management |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 69 | |
| 70 | .. code-block:: yaml |
| 71 | |
| 72 | salt: |
| 73 | master: |
| 74 | enabled: true |
| 75 | ... |
| 76 | environment: |
| 77 | prd: |
Petr Michalec | 7a2f1d2 | 2017-05-17 22:08:32 +0200 | [diff] [blame] | 78 | keystone: |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 79 | source: pkg |
| 80 | name: salt-formula-keystone |
Petr Michalec | 7a2f1d2 | 2017-05-17 22:08:32 +0200 | [diff] [blame] | 81 | nova: |
| 82 | source: pkg |
| 83 | name: salt-formula-keystone |
| 84 | version: 0.1+0~20160818133412.24~1.gbp6e1ebb |
| 85 | postresql: |
| 86 | source: pkg |
| 87 | name: salt-formula-postgresql |
| 88 | version: purged |
| 89 | |
| 90 | Formula keystone is installed latest version and the formulas without version are installed in one call to aptpkg module. |
| 91 | If the version attribute is present sls iterates over formulas and take action to install specific version or remove it. |
| 92 | The version attribute may have these values ``[latest|purged|removed|<VERSION>]``. |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 93 | |
| 94 | Clone master branch of keystone formula as local feature branch |
| 95 | |
| 96 | .. code-block:: yaml |
| 97 | |
| 98 | salt: |
| 99 | master: |
| 100 | enabled: true |
| 101 | ... |
| 102 | environment: |
| 103 | dev: |
| 104 | formula: |
| 105 | keystone: |
| 106 | source: git |
| 107 | address: git@github.com:openstack/salt-formula-keystone.git |
| 108 | revision: master |
| 109 | branch: feature |
| 110 | |
| 111 | Salt master with specified formula refs (for example for Gerrit review) |
| 112 | |
| 113 | .. code-block:: yaml |
| 114 | |
| 115 | salt: |
| 116 | master: |
| 117 | enabled: true |
| 118 | ... |
| 119 | environment: |
| 120 | dev: |
| 121 | formula: |
| 122 | keystone: |
| 123 | source: git |
| 124 | address: https://git.openstack.org/openstack/salt-formula-keystone |
| 125 | revision: refs/changes/56/123456/1 |
| 126 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 127 | Salt master with logging handlers |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 128 | |
| 129 | .. code-block:: yaml |
| 130 | |
| 131 | salt: |
| 132 | master: |
| 133 | enabled: true |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 134 | handler: |
| 135 | handler01: |
| 136 | engine: udp |
| 137 | bind: |
| 138 | host: 127.0.0.1 |
| 139 | port: 9999 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 140 | minion: |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 141 | handler: |
| 142 | handler01: |
| 143 | engine: udp |
| 144 | bind: |
| 145 | host: 127.0.0.1 |
| 146 | port: 9999 |
| 147 | handler02: |
| 148 | engine: zmq |
| 149 | bind: |
| 150 | host: 127.0.0.1 |
| 151 | port: 9999 |
| 152 | |
Ales Komarek | a9fc6e7 | 2017-09-06 15:02:40 +0200 | [diff] [blame] | 153 | |
| 154 | Salt engine definition for saltgraph metadata collector |
| 155 | |
| 156 | .. code-block:: yaml |
| 157 | |
| 158 | salt: |
| 159 | master: |
| 160 | engine: |
| 161 | graph_metadata: |
| 162 | engine: saltgraph |
| 163 | host: 127.0.0.1 |
| 164 | port: 5432 |
| 165 | user: salt |
| 166 | password: salt |
| 167 | database: salt |
| 168 | |
| 169 | Salt engine definition for sending events from docker events |
| 170 | |
| 171 | .. code-block:: yaml |
| 172 | |
| 173 | salt: |
| 174 | master: |
| 175 | engine: |
| 176 | docker_events: |
| 177 | docker_url: unix://var/run/docker.sock |
| 178 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 179 | Salt master peer setup for remote certificate signing |
Jakub Pavlik | d485984 | 2016-05-23 10:48:04 +0200 | [diff] [blame] | 180 | |
| 181 | .. code-block:: yaml |
| 182 | |
| 183 | salt: |
| 184 | master: |
| 185 | peer: |
| 186 | ".*": |
| 187 | - x509.sign_remote_certificate |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 188 | |
Tomáš Kukrál | 8922aef | 2017-05-10 10:27:04 +0200 | [diff] [blame] | 189 | Configure verbosity of state output (used for `salt` command) |
| 190 | |
| 191 | .. code-block:: yaml |
| 192 | |
| 193 | salt: |
| 194 | master: |
Tomáš Kukrál | 044667b | 2017-05-11 10:12:15 +0200 | [diff] [blame] | 195 | state_output: changes |
Tomáš Kukrál | 8922aef | 2017-05-10 10:27:04 +0200 | [diff] [blame] | 196 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 197 | |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 198 | Salt synchronise node pillar and modules after start |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 199 | |
| 200 | .. code-block:: yaml |
| 201 | |
| 202 | salt: |
| 203 | master: |
| 204 | reactor: |
| 205 | salt/minion/*/start: |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 206 | - salt://salt/reactor/node_start.sls |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 207 | |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 208 | Trigger basic node install |
| 209 | |
| 210 | .. code-block:: yaml |
| 211 | |
| 212 | salt: |
| 213 | master: |
| 214 | reactor: |
| 215 | salt/minion/install: |
| 216 | - salt://salt/reactor/node_install.sls |
| 217 | |
| 218 | Sample event to trigger the node installation |
| 219 | |
| 220 | .. code-block:: bash |
| 221 | |
| 222 | salt-call event.send 'salt/minion/install' |
| 223 | |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 224 | Run any defined orchestration pipeline |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 225 | |
| 226 | .. code-block:: yaml |
| 227 | |
| 228 | salt: |
| 229 | master: |
| 230 | reactor: |
| 231 | salt/orchestrate/start: |
| 232 | - salt://salt/reactor/orchestrate_start.sls |
| 233 | |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 234 | Event to trigger the orchestration pipeline |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 235 | |
| 236 | .. code-block:: bash |
| 237 | |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 238 | salt-call event.send 'salt/orchestrate/start' "{'orchestrate': 'salt/orchestrate/infra_install.sls'}" |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 239 | |
Ales Komarek | 3ed7c43 | 2017-08-24 16:15:49 +0200 | [diff] [blame] | 240 | Synchronise modules and pillars on minion start. |
| 241 | |
| 242 | .. code-block:: yaml |
| 243 | |
| 244 | salt: |
| 245 | master: |
| 246 | reactor: |
| 247 | 'salt/minion/*/start': |
| 248 | - salt://salt/reactor/minion_start.sls |
| 249 | |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 250 | Add and/or remove the minion key |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 251 | |
| 252 | .. code-block:: yaml |
| 253 | |
| 254 | salt: |
| 255 | master: |
| 256 | reactor: |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 257 | salt/key/create: |
| 258 | - salt://salt/reactor/key_create.sls |
| 259 | salt/key/remove: |
| 260 | - salt://salt/reactor/key_remove.sls |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 261 | |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 262 | Event to trigger the key creation |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 263 | |
| 264 | .. code-block:: bash |
| 265 | |
Adam Tengler | 6218896 | 2017-09-04 13:34:44 +0000 | [diff] [blame] | 266 | salt-call event.send 'salt/key/create' \ |
| 267 | > "{'node_id': 'id-of-minion', 'node_host': '172.16.10.100', 'orch_post_create': 'kubernetes.orchestrate.compute_install', 'post_create_pillar': {'node_name': 'id-of-minion'}}" |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 268 | |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 269 | .. note:: |
| 270 | |
| 271 | You can add pass additional `orch_pre_create`, `orch_post_create`, |
| 272 | `orch_pre_remove` or `orch_post_remove` parameters to the event to call |
| 273 | extra orchestrate files. This can be useful for example for |
| 274 | registering/unregistering nodes from the monitoring alarms or dashboards. |
| 275 | |
| 276 | The key creation event needs to be run from other machine than the one |
| 277 | being registered. |
| 278 | |
| 279 | Event to trigger the key removal |
| 280 | |
| 281 | .. code-block:: bash |
| 282 | |
| 283 | salt-call event.send 'salt/key/remove' |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 284 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 285 | |
| 286 | Encrypted pillars |
| 287 | ----------------- |
| 288 | |
| 289 | Note: NACL + below configuration will be available in Salt > 2017.7. |
| 290 | |
| 291 | External resources: |
| 292 | |
| 293 | - Tutorial to configure salt + reclass ext_pillar and nacl: http://apealive.net/post/2017-09-salt-nacl-ext-pillar/ |
| 294 | - Saltstack documentation: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.nacl.html |
| 295 | |
| 296 | Configure salt NACL module: |
| 297 | |
| 298 | .. code-block:: shell |
| 299 | |
| 300 | pip install --upgrade libnacl===1.5.2 |
| 301 | salt-call --local nacl.keygen /etc/salt/pki/master/nacl |
| 302 | |
| 303 | local: |
| 304 | saved sk_file:/etc/salt/pki/master/nacl pk_file: /etc/salt/pki/master/nacl.pub |
| 305 | |
| 306 | |
| 307 | .. code-block:: yaml |
| 308 | |
| 309 | salt: |
| 310 | master: |
| 311 | pillar: |
| 312 | reclass: *reclass |
| 313 | nacl: |
| 314 | index: 99 |
| 315 | nacl: |
| 316 | box_type: sealedbox |
| 317 | sk_file: /etc/salt/pki/master/nacl |
| 318 | pk_file: /etc/salt/pki/master/nacl.pub |
| 319 | #sk: None |
| 320 | #pk: None |
| 321 | |
| 322 | NACL encrypt secrets: |
| 323 | |
| 324 | salt-call --local nacl.enc 'my_secret_value' pk_file=/etc/salt/pki/master/nacl.pub |
| 325 | hXTkJpC1hcKMS7yZVGESutWrkvzusXfETXkacSklIxYjfWDlMJmR37MlmthdIgjXpg4f2AlBKb8tc9Woma7q |
| 326 | # or |
| 327 | salt-run nacl.enc 'myotherpass' |
| 328 | ADDFD0Rav6p6+63sojl7Htfrncp5rrDVyeE4BSPO7ipq8fZuLDIVAzQLf4PCbDqi+Fau5KD3/J/E+Pw= |
| 329 | |
| 330 | |
| 331 | NACL encrypted values on pillar: |
| 332 | |
| 333 | Use Boxed syntax `NACL[CryptedValue=]` to encode value on pillar: |
| 334 | |
| 335 | .. code-block:: yaml |
| 336 | |
| 337 | my_pillar: |
| 338 | my_nacl: |
| 339 | key0: unencrypted_value |
| 340 | key1: NACL[hXTkJpC1hcKMS7yZVGESutWrkvzusXfETXkacSklIxYjfWDlMJmR37MlmthdIgjXpg4f2AlBKb8tc9Woma7q] |
| 341 | |
| 342 | NACL large files: |
| 343 | |
| 344 | .. code-block:: shell |
| 345 | salt-call nacl.enc_file /tmp/cert.crt out=/srv/salt/env/dev/cert.nacl |
| 346 | # or more advanced |
| 347 | cert=$(cat /tmp/cert.crt) |
| 348 | salt-call --out=newline_values_only nacl.enc_pub data="$cert" > /srv/salt/env/dev/cert.nacl |
| 349 | |
| 350 | |
| 351 | NACL within template/native pillars: |
| 352 | |
| 353 | pillarexample: |
| 354 | user: root |
| 355 | password1: {{salt.nacl.dec('DRB7Q6/X5gGSRCTpZyxS6hlbWj0llUA+uaVyvou3vJ4=')|json}} |
| 356 | cert_key: {{salt.nacl.dec_file('/srv/salt/env/dev/certs/example.com/cert.nacl')|json}} |
| 357 | cert_key2: {{salt.nacl.dec_file('salt:///certs/example.com/cert2.nacl')|json}} |
| 358 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 359 | Salt syndic |
| 360 | ----------- |
| 361 | |
| 362 | The master of masters |
| 363 | |
| 364 | .. code-block:: yaml |
| 365 | |
| 366 | salt: |
| 367 | master: |
| 368 | enabled: true |
| 369 | order_masters: True |
| 370 | |
| 371 | Lower syndicated master |
| 372 | |
| 373 | .. code-block:: yaml |
| 374 | |
| 375 | salt: |
| 376 | syndic: |
| 377 | enabled: true |
| 378 | master: |
| 379 | host: master-of-master-host |
| 380 | timeout: 5 |
| 381 | |
| 382 | Syndicated master with multiple master of masters |
| 383 | |
| 384 | .. code-block:: yaml |
| 385 | |
| 386 | salt: |
| 387 | syndic: |
| 388 | enabled: true |
| 389 | masters: |
| 390 | - host: master-of-master-host1 |
| 391 | - host: master-of-master-host2 |
| 392 | timeout: 5 |
| 393 | |
| 394 | |
| 395 | Salt-minion proxy |
| 396 | ----------------- |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 397 | |
| 398 | Salt proxy pillar |
| 399 | |
| 400 | .. code-block:: yaml |
| 401 | |
| 402 | salt: |
| 403 | minion: |
Jiri Broulik | 8827524 | 2017-05-24 17:21:17 +0200 | [diff] [blame] | 404 | proxy_minion: |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 405 | master: localhost |
| 406 | device: |
| 407 | vsrx01.mydomain.local: |
| 408 | enabled: true |
| 409 | engine: napalm |
| 410 | csr1000v.mydomain.local: |
| 411 | enabled: true |
| 412 | engine: napalm |
| 413 | |
| 414 | .. note:: This is pillar of the the real salt-minion |
| 415 | |
| 416 | |
| 417 | Proxy pillar for IOS device |
| 418 | |
| 419 | .. code-block:: yaml |
| 420 | |
| 421 | proxy: |
| 422 | proxytype: napalm |
| 423 | driver: ios |
| 424 | host: csr1000v.mydomain.local |
| 425 | username: root |
| 426 | passwd: r00tme |
| 427 | |
| 428 | .. note:: This is pillar of the node thats not able to run salt-minion itself |
| 429 | |
| 430 | |
| 431 | Proxy pillar for JunOS device |
| 432 | |
| 433 | .. code-block:: yaml |
| 434 | |
| 435 | proxy: |
| 436 | proxytype: napalm |
| 437 | driver: junos |
| 438 | host: vsrx01.mydomain.local |
| 439 | username: root |
| 440 | passwd: r00tme |
| 441 | optional_args: |
| 442 | config_format: set |
| 443 | |
| 444 | .. note:: This is pillar of the node thats not able to run salt-minion itself |
| 445 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 446 | |
| 447 | Salt SSH |
| 448 | -------- |
| 449 | |
| 450 | Salt SSH with sudoer using key |
| 451 | |
| 452 | .. literalinclude:: tests/pillar/master_ssh_minion_key.sls |
| 453 | :language: yaml |
| 454 | |
| 455 | Salt SSH with sudoer using password |
| 456 | |
| 457 | .. literalinclude:: tests/pillar/master_ssh_minion_password.sls |
| 458 | :language: yaml |
| 459 | |
| 460 | Salt SSH with root using password |
| 461 | |
| 462 | .. literalinclude:: tests/pillar/master_ssh_minion_root.sls |
| 463 | :language: yaml |
| 464 | |
| 465 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 466 | Salt minion |
| 467 | ----------- |
| 468 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 469 | Simplest Salt minion setup with central configuration node |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 470 | |
| 471 | .. code-block:: yaml |
| 472 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 473 | .. literalinclude:: tests/pillar/minion_master.sls |
| 474 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 475 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 476 | Multi-master Salt minion setup |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 477 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 478 | .. literalinclude:: tests/pillar/minion_multi_master.sls |
| 479 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 480 | |
| 481 | Salt minion with salt mine options |
| 482 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 483 | .. literalinclude:: tests/pillar/minion_mine.sls |
| 484 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 485 | |
| 486 | Salt minion with graphing dependencies |
| 487 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 488 | .. literalinclude:: tests/pillar/minion_graph.sls |
| 489 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 490 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 491 | Salt minion behind HTTP proxy |
Ondrej Smola | c2d3e6f | 2017-03-26 17:52:40 +0200 | [diff] [blame] | 492 | |
| 493 | .. code-block:: yaml |
| 494 | |
| 495 | salt: |
| 496 | minion: |
| 497 | proxy: |
| 498 | host: 127.0.0.1 |
| 499 | port: 3128 |
| 500 | |
Sam Stoelinga | bb4c04b | 2017-06-26 15:47:19 -0700 | [diff] [blame] | 501 | Salt minion to specify non-default HTTP backend. The default tornado backend |
| 502 | does not respect HTTP proxy settings set as environment variables. This is |
| 503 | useful for cases where you need to set no_proxy lists. |
| 504 | |
| 505 | .. code-block:: yaml |
| 506 | |
| 507 | salt: |
| 508 | minion: |
| 509 | backend: urllib2 |
| 510 | |
| 511 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 512 | Salt minion with PKI certificate authority (CA) |
Ales Komarek | 5d17e4b | 2016-04-08 11:53:53 +0200 | [diff] [blame] | 513 | |
| 514 | .. literalinclude:: tests/pillar/minion_pki_ca.sls |
| 515 | :language: yaml |
| 516 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 517 | Salt minion using PKI certificate |
Ales Komarek | 5d17e4b | 2016-04-08 11:53:53 +0200 | [diff] [blame] | 518 | |
| 519 | .. literalinclude:: tests/pillar/minion_pki_cert.sls |
| 520 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 521 | |
Petr Michalec | 56066ac | 2017-06-01 10:52:56 +0200 | [diff] [blame] | 522 | Salt minion trust CA certificates issued by salt CA on a specific host (ie: salt-master node) |
| 523 | |
| 524 | .. code-block:: yaml |
| 525 | |
| 526 | salt: |
| 527 | minion: |
| 528 | trusted_ca_minions: |
| 529 | - cfg01 |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 530 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 531 | Salt control (cloud/kvm/docker) |
| 532 | ------------------------------- |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 533 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 534 | Salt cloud with local OpenStack provider |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 535 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 536 | .. literalinclude:: tests/pillar/control_cloud_openstack.sls |
| 537 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 538 | |
| 539 | Salt cloud with Digital Ocean provider |
| 540 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 541 | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls |
| 542 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 543 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 544 | Salt virt with KVM cluster |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 545 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 546 | .. literalinclude:: tests/pillar/control_virt.sls |
| 547 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 548 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 549 | |
| 550 | Usage |
| 551 | ===== |
| 552 | |
| 553 | Working with salt-cloud |
| 554 | |
| 555 | .. code-block:: bash |
| 556 | |
| 557 | salt-cloud -m /path/to/map --assume-yes |
| 558 | |
| 559 | Debug LIBCLOUD for salt-cloud connection |
| 560 | |
| 561 | .. code-block:: bash |
| 562 | |
| 563 | export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all |
| 564 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 565 | |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 566 | More Information |
| 567 | ================ |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 568 | |
| 569 | * http://salt.readthedocs.org/en/latest/ |
| 570 | * https://github.com/DanielBryan/salt-state-graph |
| 571 | * http://karlgrz.com/testing-salt-states-rapidly-with-docker/ |
| 572 | * https://mywushublog.com/2013/03/configuration-management-with-salt-stack/ |
| 573 | * http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/ |
| 574 | * https://github.com/saltstack-formulas/salt-formula |
| 575 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
| 576 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 577 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 578 | salt-cloud |
| 579 | ---------- |
| 580 | |
| 581 | * http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html |
| 582 | * http://cloudinit.readthedocs.org/en/latest/topics/examples.html |
| 583 | * http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html |
| 584 | * http://docs.saltstack.com/topics/cloud/digitalocean.html |
| 585 | * http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html |
| 586 | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html |
| 587 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 588 | |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 589 | |
| 590 | Documentation and Bugs |
| 591 | ====================== |
| 592 | |
| 593 | To learn how to install and update salt-formulas, consult the documentation |
| 594 | available online at: |
| 595 | |
| 596 | http://salt-formulas.readthedocs.io/ |
| 597 | |
| 598 | In the unfortunate event that bugs are discovered, they should be reported to |
| 599 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 600 | formula: |
| 601 | |
| 602 | https://github.com/salt-formulas/salt-formula-salt/issues |
| 603 | |
| 604 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 605 | use Launchpad salt-formulas project: |
| 606 | |
| 607 | https://launchpad.net/salt-formulas |
| 608 | |
| 609 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 610 | |
| 611 | https://launchpad.net/~salt-formulas-users |
| 612 | |
| 613 | Developers wishing to work on the salt-formulas projects should always base |
| 614 | their work on master branch and submit pull request against specific formula. |
| 615 | |
| 616 | https://github.com/salt-formulas/salt-formula-salt |
| 617 | |
| 618 | Any questions or feedback is always welcome so feel free to join our IRC |
| 619 | channel: |
| 620 | |
| 621 | #salt-formulas @ irc.freenode.net |