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