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: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 31 | api: |
| 32 | enabled: true |
Ales Komarek | cdb280f | 2016-07-27 15:37:51 +0200 | [diff] [blame] | 33 | ssl: |
| 34 | engine: salt |
| 35 | bind: |
| 36 | address: 0.0.0.0 |
| 37 | port: 8000 |
| 38 | |
| 39 | Salt master with defined user ACLs |
| 40 | |
| 41 | .. code-block:: yaml |
| 42 | |
| 43 | salt: |
| 44 | master: |
| 45 | user: |
| 46 | peter: |
| 47 | permissions: |
| 48 | - 'fs.fs' |
| 49 | - 'fs.\*' |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 50 | |
| 51 | Salt master with preset minions |
| 52 | |
| 53 | .. code-block:: yaml |
| 54 | |
| 55 | salt: |
| 56 | master: |
| 57 | enabled: true |
| 58 | ... |
| 59 | minions: |
| 60 | - name: 'node1.system.location.domain.com' |
| 61 | |
Adam Tengler | caedd97 | 2016-05-04 16:44:00 +0200 | [diff] [blame] | 62 | Salt master with alternative installation source and version (optional) - pip |
| 63 | |
| 64 | .. code-block:: yaml |
| 65 | |
| 66 | salt: |
| 67 | master: |
| 68 | enabled: true |
| 69 | ... |
| 70 | source: |
| 71 | engine: pip |
| 72 | version: 2016.3.0rc2 |
| 73 | |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 74 | Salt master with specified formula to install through apt-get |
| 75 | |
| 76 | .. code-block:: yaml |
| 77 | |
| 78 | salt: |
| 79 | master: |
| 80 | enabled: true |
| 81 | ... |
| 82 | environment: |
| 83 | prd: |
| 84 | keysone: |
| 85 | source: pkg |
| 86 | name: salt-formula-keystone |
| 87 | |
| 88 | Clone master branch of keystone formula as local feature branch |
| 89 | |
| 90 | .. code-block:: yaml |
| 91 | |
| 92 | salt: |
| 93 | master: |
| 94 | enabled: true |
| 95 | ... |
| 96 | environment: |
| 97 | dev: |
| 98 | formula: |
| 99 | keystone: |
| 100 | source: git |
| 101 | address: git@github.com:openstack/salt-formula-keystone.git |
| 102 | revision: master |
| 103 | branch: feature |
| 104 | |
| 105 | Salt master with specified formula refs (for example for Gerrit review) |
| 106 | |
| 107 | .. code-block:: yaml |
| 108 | |
| 109 | salt: |
| 110 | master: |
| 111 | enabled: true |
| 112 | ... |
| 113 | environment: |
| 114 | dev: |
| 115 | formula: |
| 116 | keystone: |
| 117 | source: git |
| 118 | address: https://git.openstack.org/openstack/salt-formula-keystone |
| 119 | revision: refs/changes/56/123456/1 |
| 120 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 121 | Salt master syndicate master of masters |
| 122 | |
| 123 | .. code-block:: yaml |
| 124 | |
| 125 | salt: |
| 126 | master: |
| 127 | enabled: true |
| 128 | ... |
| 129 | syndic: |
| 130 | mode: master |
| 131 | |
| 132 | Salt master syndicate (client) master |
| 133 | |
| 134 | .. code-block:: yaml |
| 135 | |
| 136 | salt: |
| 137 | master: |
| 138 | enabled: true |
| 139 | ... |
| 140 | syndicate: |
| 141 | mode: client |
| 142 | host: master-master |
| 143 | |
| 144 | Salt master with custom handlers |
| 145 | |
| 146 | .. code-block:: yaml |
| 147 | |
| 148 | salt: |
| 149 | master: |
| 150 | enabled: true |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 151 | handler: |
| 152 | handler01: |
| 153 | engine: udp |
| 154 | bind: |
| 155 | host: 127.0.0.1 |
| 156 | port: 9999 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 157 | minion: |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 158 | handler: |
| 159 | handler01: |
| 160 | engine: udp |
| 161 | bind: |
| 162 | host: 127.0.0.1 |
| 163 | port: 9999 |
| 164 | handler02: |
| 165 | engine: zmq |
| 166 | bind: |
| 167 | host: 127.0.0.1 |
| 168 | port: 9999 |
| 169 | |
Jakub Pavlik | d485984 | 2016-05-23 10:48:04 +0200 | [diff] [blame] | 170 | Salt master peer for remote certificate sign. |
| 171 | |
| 172 | .. code-block:: yaml |
| 173 | |
| 174 | salt: |
| 175 | master: |
| 176 | peer: |
| 177 | ".*": |
| 178 | - x509.sign_remote_certificate |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 179 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame^] | 180 | |
| 181 | Salt SSH |
| 182 | -------- |
| 183 | |
| 184 | Salt SSH with sudoer using key |
| 185 | |
| 186 | .. literalinclude:: tests/pillar/master_ssh_minion_key.sls |
| 187 | :language: yaml |
| 188 | |
| 189 | Salt SSH with sudoer using password |
| 190 | |
| 191 | .. literalinclude:: tests/pillar/master_ssh_minion_password.sls |
| 192 | :language: yaml |
| 193 | |
| 194 | Salt SSH with root using password |
| 195 | |
| 196 | .. literalinclude:: tests/pillar/master_ssh_minion_root.sls |
| 197 | :language: yaml |
| 198 | |
| 199 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 200 | Salt minion |
| 201 | ----------- |
| 202 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 203 | Simplest Salt minion setup with central configuration node |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 204 | |
| 205 | .. code-block:: yaml |
| 206 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 207 | .. literalinclude:: tests/pillar/minion_master.sls |
| 208 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 209 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 210 | Multi-master Salt minion setup |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 211 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 212 | .. literalinclude:: tests/pillar/minion_multi_master.sls |
| 213 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 214 | |
| 215 | Salt minion with salt mine options |
| 216 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 217 | .. literalinclude:: tests/pillar/minion_mine.sls |
| 218 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 219 | |
| 220 | Salt minion with graphing dependencies |
| 221 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 222 | .. literalinclude:: tests/pillar/minion_graph.sls |
| 223 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 224 | |
Ales Komarek | 5d17e4b | 2016-04-08 11:53:53 +0200 | [diff] [blame] | 225 | Salt minion with PKI CA |
| 226 | |
| 227 | .. literalinclude:: tests/pillar/minion_pki_ca.sls |
| 228 | :language: yaml |
| 229 | |
| 230 | Salt minion with PKI certificate |
| 231 | |
| 232 | .. literalinclude:: tests/pillar/minion_pki_cert.sls |
| 233 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 234 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame^] | 235 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 236 | Salt control (cloud/kvm/docker) |
| 237 | ------------------------------- |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 238 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 239 | Salt cloud with local OpenStack provider |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 240 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 241 | .. literalinclude:: tests/pillar/control_cloud_openstack.sls |
| 242 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 243 | |
| 244 | Salt cloud with Digital Ocean provider |
| 245 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 246 | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls |
| 247 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 248 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame^] | 249 | Salt virt with KVM cluster |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 250 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 251 | .. literalinclude:: tests/pillar/control_virt.sls |
| 252 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 253 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 254 | |
| 255 | Usage |
| 256 | ===== |
| 257 | |
| 258 | Working with salt-cloud |
| 259 | |
| 260 | .. code-block:: bash |
| 261 | |
| 262 | salt-cloud -m /path/to/map --assume-yes |
| 263 | |
| 264 | Debug LIBCLOUD for salt-cloud connection |
| 265 | |
| 266 | .. code-block:: bash |
| 267 | |
| 268 | export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all |
| 269 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 270 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 271 | Read more |
| 272 | ========= |
| 273 | |
| 274 | * http://salt.readthedocs.org/en/latest/ |
| 275 | * https://github.com/DanielBryan/salt-state-graph |
| 276 | * http://karlgrz.com/testing-salt-states-rapidly-with-docker/ |
| 277 | * https://mywushublog.com/2013/03/configuration-management-with-salt-stack/ |
| 278 | * http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/ |
| 279 | * https://github.com/saltstack-formulas/salt-formula |
| 280 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
| 281 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 282 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 283 | salt-cloud |
| 284 | ---------- |
| 285 | |
| 286 | * http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html |
| 287 | * http://cloudinit.readthedocs.org/en/latest/topics/examples.html |
| 288 | * http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html |
| 289 | * http://docs.saltstack.com/topics/cloud/digitalocean.html |
| 290 | * http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html |
| 291 | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html |
| 292 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 293 | |