Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
Filip Pytloun | e3a26ae | 2016-08-22 14:44:42 +0200 | [diff] [blame] | 2 | ==== |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 3 | Salt |
| 4 | ==== |
| 5 | |
| 6 | Salt 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 | |
| 8 | Salt delivers a dynamic communication bus for infrastructures that can be used for orchestration, remote execution, configuration management and much more. |
| 9 | |
| 10 | Sample pillars |
| 11 | ============== |
| 12 | |
| 13 | Salt master |
| 14 | ----------- |
| 15 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 16 | Salt master with base production environment and pillar tree as metadata backend |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 17 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 18 | .. literalinclude:: tests/pillar/master_single_pillar.sls |
| 19 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 20 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 21 | Salt master with reclass ENC as 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_reclass.sls |
| 24 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 25 | |
| 26 | Salt master with API |
| 27 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 28 | .. literalinclude:: tests/pillar/master_api.sls |
| 29 | :language: yaml |
Ales Komarek | cdb280f | 2016-07-27 15:37:51 +0200 | [diff] [blame] | 30 | |
| 31 | Salt master with defined user ACLs |
| 32 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 33 | .. literalinclude:: tests/pillar/master_acl.sls |
| 34 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 35 | |
| 36 | Salt master with preset minions |
| 37 | |
| 38 | .. code-block:: yaml |
| 39 | |
| 40 | salt: |
| 41 | master: |
| 42 | enabled: true |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 43 | minions: |
| 44 | - name: 'node1.system.location.domain.com' |
| 45 | |
Adam Tengler | caedd97 | 2016-05-04 16:44:00 +0200 | [diff] [blame] | 46 | Salt master with alternative installation source and version (optional) - pip |
| 47 | |
| 48 | .. code-block:: yaml |
| 49 | |
| 50 | salt: |
| 51 | master: |
| 52 | enabled: true |
| 53 | ... |
| 54 | source: |
| 55 | engine: pip |
| 56 | version: 2016.3.0rc2 |
| 57 | |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 58 | Salt master with specified formula to install through apt-get |
| 59 | |
| 60 | .. code-block:: yaml |
| 61 | |
| 62 | salt: |
| 63 | master: |
| 64 | enabled: true |
| 65 | ... |
| 66 | environment: |
| 67 | prd: |
| 68 | keysone: |
| 69 | source: pkg |
| 70 | name: salt-formula-keystone |
| 71 | |
| 72 | Clone master branch of keystone formula as local feature branch |
| 73 | |
| 74 | .. code-block:: yaml |
| 75 | |
| 76 | salt: |
| 77 | master: |
| 78 | enabled: true |
| 79 | ... |
| 80 | environment: |
| 81 | dev: |
| 82 | formula: |
| 83 | keystone: |
| 84 | source: git |
| 85 | address: git@github.com:openstack/salt-formula-keystone.git |
| 86 | revision: master |
| 87 | branch: feature |
| 88 | |
| 89 | Salt master with specified formula refs (for example for Gerrit review) |
| 90 | |
| 91 | .. code-block:: yaml |
| 92 | |
| 93 | salt: |
| 94 | master: |
| 95 | enabled: true |
| 96 | ... |
| 97 | environment: |
| 98 | dev: |
| 99 | formula: |
| 100 | keystone: |
| 101 | source: git |
| 102 | address: https://git.openstack.org/openstack/salt-formula-keystone |
| 103 | revision: refs/changes/56/123456/1 |
| 104 | |
Ales Komarek | a33b905 | 2017-01-16 07:10:27 -0800 | [diff] [blame] | 105 | Salt syndic: Master of masters |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 106 | |
| 107 | .. code-block:: yaml |
| 108 | |
| 109 | salt: |
| 110 | master: |
| 111 | enabled: true |
Ales Komarek | a33b905 | 2017-01-16 07:10:27 -0800 | [diff] [blame] | 112 | order_masters: True |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 113 | |
Ales Komarek | a33b905 | 2017-01-16 07:10:27 -0800 | [diff] [blame] | 114 | Salt syndic: Lower master |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 115 | |
| 116 | .. code-block:: yaml |
| 117 | |
| 118 | salt: |
Ales Komarek | a33b905 | 2017-01-16 07:10:27 -0800 | [diff] [blame] | 119 | syndic: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 120 | enabled: true |
Ales Komarek | a33b905 | 2017-01-16 07:10:27 -0800 | [diff] [blame] | 121 | master: |
| 122 | host: master-of-master-host |
| 123 | timeout: 5 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 124 | |
Ales Komarek | 2c5e080 | 2017-01-16 07:47:32 -0800 | [diff] [blame] | 125 | Salt syndic: Lower master with multi-master of masters |
| 126 | |
| 127 | .. code-block:: yaml |
| 128 | |
| 129 | salt: |
| 130 | syndic: |
| 131 | enabled: true |
| 132 | masters: |
| 133 | - host: master-of-master-host1 |
| 134 | - host: master-of-master-host2 |
| 135 | timeout: 5 |
| 136 | |
| 137 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 138 | Salt master with custom handlers |
| 139 | |
| 140 | .. code-block:: yaml |
| 141 | |
| 142 | salt: |
| 143 | master: |
| 144 | enabled: true |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 145 | handler: |
| 146 | handler01: |
| 147 | engine: udp |
| 148 | bind: |
| 149 | host: 127.0.0.1 |
| 150 | port: 9999 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 151 | minion: |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 152 | handler: |
| 153 | handler01: |
| 154 | engine: udp |
| 155 | bind: |
| 156 | host: 127.0.0.1 |
| 157 | port: 9999 |
| 158 | handler02: |
| 159 | engine: zmq |
| 160 | bind: |
| 161 | host: 127.0.0.1 |
| 162 | port: 9999 |
| 163 | |
Jakub Pavlik | d485984 | 2016-05-23 10:48:04 +0200 | [diff] [blame] | 164 | Salt master peer for remote certificate sign. |
| 165 | |
| 166 | .. code-block:: yaml |
| 167 | |
| 168 | salt: |
| 169 | master: |
| 170 | peer: |
| 171 | ".*": |
| 172 | - x509.sign_remote_certificate |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 173 | |
Tomáš Kukrál | 8922aef | 2017-05-10 10:27:04 +0200 | [diff] [blame^] | 174 | Configure verbosity of state output (used for `salt` command) |
| 175 | |
| 176 | .. code-block:: yaml |
| 177 | |
| 178 | salt: |
| 179 | master: |
| 180 | state_output: terse |
| 181 | |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 182 | Salt proxy |
| 183 | ---------- |
| 184 | |
| 185 | Salt proxy pillar |
| 186 | |
| 187 | .. code-block:: yaml |
| 188 | |
| 189 | salt: |
| 190 | minion: |
| 191 | proxy: |
| 192 | master: localhost |
| 193 | device: |
| 194 | vsrx01.mydomain.local: |
| 195 | enabled: true |
| 196 | engine: napalm |
| 197 | csr1000v.mydomain.local: |
| 198 | enabled: true |
| 199 | engine: napalm |
| 200 | |
| 201 | .. note:: This is pillar of the the real salt-minion |
| 202 | |
| 203 | |
| 204 | Proxy pillar for IOS device |
| 205 | |
| 206 | .. code-block:: yaml |
| 207 | |
| 208 | proxy: |
| 209 | proxytype: napalm |
| 210 | driver: ios |
| 211 | host: csr1000v.mydomain.local |
| 212 | username: root |
| 213 | passwd: r00tme |
| 214 | |
| 215 | .. note:: This is pillar of the node thats not able to run salt-minion itself |
| 216 | |
| 217 | |
| 218 | Proxy pillar for JunOS device |
| 219 | |
| 220 | .. code-block:: yaml |
| 221 | |
| 222 | proxy: |
| 223 | proxytype: napalm |
| 224 | driver: junos |
| 225 | host: vsrx01.mydomain.local |
| 226 | username: root |
| 227 | passwd: r00tme |
| 228 | optional_args: |
| 229 | config_format: set |
| 230 | |
| 231 | .. note:: This is pillar of the node thats not able to run salt-minion itself |
| 232 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 233 | |
| 234 | Salt SSH |
| 235 | -------- |
| 236 | |
| 237 | Salt SSH with sudoer using key |
| 238 | |
| 239 | .. literalinclude:: tests/pillar/master_ssh_minion_key.sls |
| 240 | :language: yaml |
| 241 | |
| 242 | Salt SSH with sudoer using password |
| 243 | |
| 244 | .. literalinclude:: tests/pillar/master_ssh_minion_password.sls |
| 245 | :language: yaml |
| 246 | |
| 247 | Salt SSH with root using password |
| 248 | |
| 249 | .. literalinclude:: tests/pillar/master_ssh_minion_root.sls |
| 250 | :language: yaml |
| 251 | |
| 252 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 253 | Salt minion |
| 254 | ----------- |
| 255 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 256 | Simplest Salt minion setup with central configuration node |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 257 | |
| 258 | .. code-block:: yaml |
| 259 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 260 | .. literalinclude:: tests/pillar/minion_master.sls |
| 261 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 262 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 263 | Multi-master Salt minion setup |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 264 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 265 | .. literalinclude:: tests/pillar/minion_multi_master.sls |
| 266 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 267 | |
| 268 | Salt minion with salt mine options |
| 269 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 270 | .. literalinclude:: tests/pillar/minion_mine.sls |
| 271 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 272 | |
| 273 | Salt minion with graphing dependencies |
| 274 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 275 | .. literalinclude:: tests/pillar/minion_graph.sls |
| 276 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 277 | |
Ondrej Smola | c2d3e6f | 2017-03-26 17:52:40 +0200 | [diff] [blame] | 278 | Salt minion behind http proxy |
| 279 | |
| 280 | .. code-block:: yaml |
| 281 | |
| 282 | salt: |
| 283 | minion: |
| 284 | proxy: |
| 285 | host: 127.0.0.1 |
| 286 | port: 3128 |
| 287 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 288 | PKI CA |
| 289 | ~~~~~~ |
| 290 | |
Ales Komarek | 5d17e4b | 2016-04-08 11:53:53 +0200 | [diff] [blame] | 291 | Salt minion with PKI CA |
| 292 | |
| 293 | .. literalinclude:: tests/pillar/minion_pki_ca.sls |
| 294 | :language: yaml |
| 295 | |
| 296 | Salt minion with PKI certificate |
| 297 | |
| 298 | .. literalinclude:: tests/pillar/minion_pki_cert.sls |
| 299 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 300 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 301 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 302 | Salt control (cloud/kvm/docker) |
| 303 | ------------------------------- |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 304 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 305 | Salt cloud with local OpenStack provider |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 306 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 307 | .. literalinclude:: tests/pillar/control_cloud_openstack.sls |
| 308 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 309 | |
| 310 | Salt cloud with Digital Ocean provider |
| 311 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 312 | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls |
| 313 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 314 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 315 | Salt virt with KVM cluster |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 316 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 317 | .. literalinclude:: tests/pillar/control_virt.sls |
| 318 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 319 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 320 | |
| 321 | Usage |
| 322 | ===== |
| 323 | |
| 324 | Working with salt-cloud |
| 325 | |
| 326 | .. code-block:: bash |
| 327 | |
| 328 | salt-cloud -m /path/to/map --assume-yes |
| 329 | |
| 330 | Debug LIBCLOUD for salt-cloud connection |
| 331 | |
| 332 | .. code-block:: bash |
| 333 | |
| 334 | export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all |
| 335 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 336 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 337 | Read more |
| 338 | ========= |
| 339 | |
| 340 | * http://salt.readthedocs.org/en/latest/ |
| 341 | * https://github.com/DanielBryan/salt-state-graph |
| 342 | * http://karlgrz.com/testing-salt-states-rapidly-with-docker/ |
| 343 | * https://mywushublog.com/2013/03/configuration-management-with-salt-stack/ |
| 344 | * http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/ |
| 345 | * https://github.com/saltstack-formulas/salt-formula |
| 346 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
| 347 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 348 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 349 | salt-cloud |
| 350 | ---------- |
| 351 | |
| 352 | * http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html |
| 353 | * http://cloudinit.readthedocs.org/en/latest/topics/examples.html |
| 354 | * http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html |
| 355 | * http://docs.saltstack.com/topics/cloud/digitalocean.html |
| 356 | * http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html |
| 357 | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html |
| 358 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 359 | |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 360 | |
| 361 | Documentation and Bugs |
| 362 | ====================== |
| 363 | |
| 364 | To learn how to install and update salt-formulas, consult the documentation |
| 365 | available online at: |
| 366 | |
| 367 | http://salt-formulas.readthedocs.io/ |
| 368 | |
| 369 | In the unfortunate event that bugs are discovered, they should be reported to |
| 370 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 371 | formula: |
| 372 | |
| 373 | https://github.com/salt-formulas/salt-formula-salt/issues |
| 374 | |
| 375 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 376 | use Launchpad salt-formulas project: |
| 377 | |
| 378 | https://launchpad.net/salt-formulas |
| 379 | |
| 380 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 381 | |
| 382 | https://launchpad.net/~salt-formulas-users |
| 383 | |
| 384 | Developers wishing to work on the salt-formulas projects should always base |
| 385 | their work on master branch and submit pull request against specific formula. |
| 386 | |
| 387 | https://github.com/salt-formulas/salt-formula-salt |
| 388 | |
| 389 | Any questions or feedback is always welcome so feel free to join our IRC |
| 390 | channel: |
| 391 | |
| 392 | #salt-formulas @ irc.freenode.net |