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 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 105 | Salt master syndicate master of masters |
| 106 | |
| 107 | .. code-block:: yaml |
| 108 | |
| 109 | salt: |
| 110 | master: |
| 111 | enabled: true |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 112 | syndicate: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 113 | mode: master |
| 114 | |
| 115 | Salt master syndicate (client) master |
| 116 | |
| 117 | .. code-block:: yaml |
| 118 | |
| 119 | salt: |
| 120 | master: |
| 121 | enabled: true |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 122 | syndicate: |
| 123 | mode: client |
| 124 | host: master-master |
| 125 | |
| 126 | Salt master with custom handlers |
| 127 | |
| 128 | .. code-block:: yaml |
| 129 | |
| 130 | salt: |
| 131 | master: |
| 132 | enabled: true |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 133 | handler: |
| 134 | handler01: |
| 135 | engine: udp |
| 136 | bind: |
| 137 | host: 127.0.0.1 |
| 138 | port: 9999 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 139 | minion: |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 140 | handler: |
| 141 | handler01: |
| 142 | engine: udp |
| 143 | bind: |
| 144 | host: 127.0.0.1 |
| 145 | port: 9999 |
| 146 | handler02: |
| 147 | engine: zmq |
| 148 | bind: |
| 149 | host: 127.0.0.1 |
| 150 | port: 9999 |
| 151 | |
Jakub Pavlik | d485984 | 2016-05-23 10:48:04 +0200 | [diff] [blame] | 152 | Salt master peer for remote certificate sign. |
| 153 | |
| 154 | .. code-block:: yaml |
| 155 | |
| 156 | salt: |
| 157 | master: |
| 158 | peer: |
| 159 | ".*": |
| 160 | - x509.sign_remote_certificate |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 161 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 162 | |
| 163 | Salt SSH |
| 164 | -------- |
| 165 | |
| 166 | Salt SSH with sudoer using key |
| 167 | |
| 168 | .. literalinclude:: tests/pillar/master_ssh_minion_key.sls |
| 169 | :language: yaml |
| 170 | |
| 171 | Salt SSH with sudoer using password |
| 172 | |
| 173 | .. literalinclude:: tests/pillar/master_ssh_minion_password.sls |
| 174 | :language: yaml |
| 175 | |
| 176 | Salt SSH with root using password |
| 177 | |
| 178 | .. literalinclude:: tests/pillar/master_ssh_minion_root.sls |
| 179 | :language: yaml |
| 180 | |
| 181 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 182 | Salt minion |
| 183 | ----------- |
| 184 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 185 | Simplest Salt minion setup with central configuration node |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 186 | |
| 187 | .. code-block:: yaml |
| 188 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 189 | .. literalinclude:: tests/pillar/minion_master.sls |
| 190 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 191 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 192 | Multi-master Salt minion setup |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 193 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 194 | .. literalinclude:: tests/pillar/minion_multi_master.sls |
| 195 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 196 | |
| 197 | Salt minion with salt mine options |
| 198 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 199 | .. literalinclude:: tests/pillar/minion_mine.sls |
| 200 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 201 | |
| 202 | Salt minion with graphing dependencies |
| 203 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 204 | .. literalinclude:: tests/pillar/minion_graph.sls |
| 205 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 206 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 207 | PKI CA |
| 208 | ~~~~~~ |
| 209 | |
Ales Komarek | 5d17e4b | 2016-04-08 11:53:53 +0200 | [diff] [blame] | 210 | Salt minion with PKI CA |
| 211 | |
| 212 | .. literalinclude:: tests/pillar/minion_pki_ca.sls |
| 213 | :language: yaml |
| 214 | |
| 215 | Salt minion with PKI certificate |
| 216 | |
| 217 | .. literalinclude:: tests/pillar/minion_pki_cert.sls |
| 218 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 219 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 220 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 221 | Salt control (cloud/kvm/docker) |
| 222 | ------------------------------- |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 223 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 224 | Salt cloud with local OpenStack provider |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 225 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 226 | .. literalinclude:: tests/pillar/control_cloud_openstack.sls |
| 227 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 228 | |
| 229 | Salt cloud with Digital Ocean provider |
| 230 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 231 | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls |
| 232 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 233 | |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 234 | Salt virt with KVM cluster |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 235 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 236 | .. literalinclude:: tests/pillar/control_virt.sls |
| 237 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 238 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 239 | |
| 240 | Usage |
| 241 | ===== |
| 242 | |
| 243 | Working with salt-cloud |
| 244 | |
| 245 | .. code-block:: bash |
| 246 | |
| 247 | salt-cloud -m /path/to/map --assume-yes |
| 248 | |
| 249 | Debug LIBCLOUD for salt-cloud connection |
| 250 | |
| 251 | .. code-block:: bash |
| 252 | |
| 253 | export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all |
| 254 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 255 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 256 | Read more |
| 257 | ========= |
| 258 | |
| 259 | * http://salt.readthedocs.org/en/latest/ |
| 260 | * https://github.com/DanielBryan/salt-state-graph |
| 261 | * http://karlgrz.com/testing-salt-states-rapidly-with-docker/ |
| 262 | * https://mywushublog.com/2013/03/configuration-management-with-salt-stack/ |
| 263 | * http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/ |
| 264 | * https://github.com/saltstack-formulas/salt-formula |
| 265 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
| 266 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 267 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 268 | salt-cloud |
| 269 | ---------- |
| 270 | |
| 271 | * http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html |
| 272 | * http://cloudinit.readthedocs.org/en/latest/topics/examples.html |
| 273 | * http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html |
| 274 | * http://docs.saltstack.com/topics/cloud/digitalocean.html |
| 275 | * http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html |
| 276 | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html |
| 277 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 278 | |