Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
| 2 | ==== |
| 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 | |
| 28 | .. code-block:: yaml |
| 29 | |
| 30 | salt: |
| 31 | master: |
| 32 | ... |
| 33 | api: |
| 34 | enabled: true |
| 35 | port: 8000 |
| 36 | |
| 37 | Salt 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 | |
Adam Tengler | caedd97 | 2016-05-04 16:44:00 +0200 | [diff] [blame] | 48 | Salt master with alternative installation source and version (optional) - pip |
| 49 | |
| 50 | .. code-block:: yaml |
| 51 | |
| 52 | salt: |
| 53 | master: |
| 54 | enabled: true |
| 55 | ... |
| 56 | source: |
| 57 | engine: pip |
| 58 | version: 2016.3.0rc2 |
| 59 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 60 | Salt master syndicate master of masters |
| 61 | |
| 62 | .. code-block:: yaml |
| 63 | |
| 64 | salt: |
| 65 | master: |
| 66 | enabled: true |
| 67 | ... |
| 68 | syndic: |
| 69 | mode: master |
| 70 | |
| 71 | Salt master syndicate (client) master |
| 72 | |
| 73 | .. code-block:: yaml |
| 74 | |
| 75 | salt: |
| 76 | master: |
| 77 | enabled: true |
| 78 | ... |
| 79 | syndicate: |
| 80 | mode: client |
| 81 | host: master-master |
| 82 | |
| 83 | Salt master with custom handlers |
| 84 | |
| 85 | .. code-block:: yaml |
| 86 | |
| 87 | salt: |
| 88 | master: |
| 89 | enabled: true |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 90 | handler: |
| 91 | handler01: |
| 92 | engine: udp |
| 93 | bind: |
| 94 | host: 127.0.0.1 |
| 95 | port: 9999 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 96 | minion: |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 97 | handler: |
| 98 | handler01: |
| 99 | engine: udp |
| 100 | bind: |
| 101 | host: 127.0.0.1 |
| 102 | port: 9999 |
| 103 | handler02: |
| 104 | engine: zmq |
| 105 | bind: |
| 106 | host: 127.0.0.1 |
| 107 | port: 9999 |
| 108 | |
Jakub Pavlik | d485984 | 2016-05-23 10:48:04 +0200 | [diff] [blame] | 109 | Salt master peer for remote certificate sign. |
| 110 | |
| 111 | .. code-block:: yaml |
| 112 | |
| 113 | salt: |
| 114 | master: |
| 115 | peer: |
| 116 | ".*": |
| 117 | - x509.sign_remote_certificate |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 118 | |
| 119 | Salt minion |
| 120 | ----------- |
| 121 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 122 | Simplest Salt minion setup with central configuration node |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 123 | |
| 124 | .. code-block:: yaml |
| 125 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 126 | .. literalinclude:: tests/pillar/minion_master.sls |
| 127 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 128 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 129 | Multi-master Salt minion setup |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 130 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 131 | .. literalinclude:: tests/pillar/minion_multi_master.sls |
| 132 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 133 | |
| 134 | Salt minion with salt mine options |
| 135 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 136 | .. literalinclude:: tests/pillar/minion_mine.sls |
| 137 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 138 | |
| 139 | Salt minion with graphing dependencies |
| 140 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 141 | .. literalinclude:: tests/pillar/minion_graph.sls |
| 142 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 143 | |
Ales Komarek | 5d17e4b | 2016-04-08 11:53:53 +0200 | [diff] [blame] | 144 | Salt minion with PKI CA |
| 145 | |
| 146 | .. literalinclude:: tests/pillar/minion_pki_ca.sls |
| 147 | :language: yaml |
| 148 | |
| 149 | Salt minion with PKI certificate |
| 150 | |
| 151 | .. literalinclude:: tests/pillar/minion_pki_cert.sls |
| 152 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 153 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 154 | Salt control (cloud/kvm/docker) |
| 155 | ------------------------------- |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 156 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 157 | Salt cloud with local OpenStack provider |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 158 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 159 | .. literalinclude:: tests/pillar/control_cloud_openstack.sls |
| 160 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 161 | |
| 162 | Salt cloud with Digital Ocean provider |
| 163 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 164 | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls |
| 165 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 166 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 167 | Salt virt KVM cluster |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 168 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 169 | .. literalinclude:: tests/pillar/control_virt.sls |
| 170 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 171 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 172 | |
| 173 | Usage |
| 174 | ===== |
| 175 | |
| 176 | Working with salt-cloud |
| 177 | |
| 178 | .. code-block:: bash |
| 179 | |
| 180 | salt-cloud -m /path/to/map --assume-yes |
| 181 | |
| 182 | Debug LIBCLOUD for salt-cloud connection |
| 183 | |
| 184 | .. code-block:: bash |
| 185 | |
| 186 | export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all |
| 187 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 188 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 189 | Read more |
| 190 | ========= |
| 191 | |
| 192 | * http://salt.readthedocs.org/en/latest/ |
| 193 | * https://github.com/DanielBryan/salt-state-graph |
| 194 | * http://karlgrz.com/testing-salt-states-rapidly-with-docker/ |
| 195 | * https://mywushublog.com/2013/03/configuration-management-with-salt-stack/ |
| 196 | * http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/ |
| 197 | * https://github.com/saltstack-formulas/salt-formula |
| 198 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
| 199 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 200 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 201 | salt-cloud |
| 202 | ---------- |
| 203 | |
| 204 | * http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html |
| 205 | * http://cloudinit.readthedocs.org/en/latest/topics/examples.html |
| 206 | * http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html |
| 207 | * http://docs.saltstack.com/topics/cloud/digitalocean.html |
| 208 | * http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html |
| 209 | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html |
| 210 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 211 | |
| 212 | salt-virt |
| 213 | --------- |
smolaon | a66f7a6 | 2016-03-08 21:49:41 +0100 | [diff] [blame] | 214 | |
| 215 | Sample pillar |
| 216 | |
| 217 | .. code-block:: yaml |
| 218 | |
| 219 | salt: |
| 220 | control: |
| 221 | enabled: True |
| 222 | virt_enabled: True |
| 223 | size: |
| 224 | medium: |
| 225 | cpu: 2 |
| 226 | ram: 1024 |
| 227 | cluster: |
| 228 | localnode: |
| 229 | domain: domain.com |
| 230 | engine: virt |
| 231 | config: |
| 232 | engine: salt |
| 233 | host: 127.0.0.1 |
| 234 | node: |
| 235 | ubuntu01: |
| 236 | provider: node001.domain.com |
| 237 | image: ubuntu-14-04-x64-1456128611.qcow2 |
| 238 | size: medium |
| 239 | disk_profile: database |
Adam Tengler | caedd97 | 2016-05-04 16:44:00 +0200 | [diff] [blame] | 240 | net_profile: testing |