Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 2 | ===== |
| 3 | Usage |
| 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 | Sample Metadata |
| 14 | =============== |
| 15 | |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 16 | Salt Master |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 17 | ----------- |
| 18 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 19 | Salt master with base formulas and pillar metadata back end: |
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 | .. literalinclude:: tests/pillar/master_single_pillar.sls |
| 22 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 23 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 24 | Salt master with reclass ENC metadata back end: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 25 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 26 | .. literalinclude:: tests/pillar/master_single_reclass.sls |
| 27 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 28 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 29 | Salt master with Architect ENC metadata back end: |
Ales Komarek | 459407b | 2018-01-18 17:16:31 +0100 | [diff] [blame] | 30 | |
| 31 | .. code-block:: yaml |
| 32 | |
| 33 | salt: |
| 34 | master: |
| 35 | enabled: true |
| 36 | pillar: |
| 37 | engine: architect |
| 38 | project: project-name |
| 39 | host: architect-api |
| 40 | port: 8181 |
| 41 | username: salt |
| 42 | password: password |
| 43 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 44 | Salt master with multiple ``ext_pillars``: |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 45 | |
Dzmitry Stremkouski | 7b15d8a | 2018-08-11 22:02:45 +0200 | [diff] [blame^] | 46 | .. code-block:: yaml |
| 47 | |
| 48 | salt: |
| 49 | master: |
| 50 | enabled: true |
| 51 | pillar: |
| 52 | engine: salt |
| 53 | source: |
| 54 | engine: local |
| 55 | ext_pillars: |
| 56 | 1: |
| 57 | module: cmd_json |
| 58 | params: '"echo {\"arg\": \"val\"}"' |
| 59 | 2: |
| 60 | module: cmd_yaml |
| 61 | params: /usr/local/bin/get_yml.sh |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 62 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 63 | Salt master with API: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 64 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 65 | .. literalinclude:: tests/pillar/master_api.sls |
| 66 | :language: yaml |
Ales Komarek | cdb280f | 2016-07-27 15:37:51 +0200 | [diff] [blame] | 67 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 68 | Salt master with defined user ACLs: |
Ales Komarek | cdb280f | 2016-07-27 15:37:51 +0200 | [diff] [blame] | 69 | |
Ales Komarek | b2c8ff6 | 2016-08-22 00:20:01 +0200 | [diff] [blame] | 70 | .. literalinclude:: tests/pillar/master_acl.sls |
| 71 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 72 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 73 | Salt master with preset minions: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 74 | |
| 75 | .. code-block:: yaml |
| 76 | |
| 77 | salt: |
| 78 | master: |
| 79 | enabled: true |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 80 | minions: |
| 81 | - name: 'node1.system.location.domain.com' |
| 82 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 83 | Salt master with pip based installation (optional): |
Adam Tengler | caedd97 | 2016-05-04 16:44:00 +0200 | [diff] [blame] | 84 | |
| 85 | .. code-block:: yaml |
| 86 | |
| 87 | salt: |
| 88 | master: |
| 89 | enabled: true |
| 90 | ... |
| 91 | source: |
| 92 | engine: pip |
| 93 | version: 2016.3.0rc2 |
| 94 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 95 | Install formula through system package management: |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 96 | |
| 97 | .. code-block:: yaml |
| 98 | |
| 99 | salt: |
| 100 | master: |
| 101 | enabled: true |
| 102 | ... |
| 103 | environment: |
| 104 | prd: |
Petr Michalec | 7a2f1d2 | 2017-05-17 22:08:32 +0200 | [diff] [blame] | 105 | keystone: |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 106 | source: pkg |
| 107 | name: salt-formula-keystone |
Petr Michalec | 7a2f1d2 | 2017-05-17 22:08:32 +0200 | [diff] [blame] | 108 | nova: |
| 109 | source: pkg |
| 110 | name: salt-formula-keystone |
| 111 | version: 0.1+0~20160818133412.24~1.gbp6e1ebb |
| 112 | postresql: |
| 113 | source: pkg |
| 114 | name: salt-formula-postgresql |
| 115 | version: purged |
| 116 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 117 | Formula keystone is installed latest version and the formulas |
| 118 | without version are installed in one call to aptpkg module. |
| 119 | If the version attribute is present sls iterates over formulas |
| 120 | and take action to install specific version or remove it. |
| 121 | The version attribute may have these values |
| 122 | ``[latest|purged|removed|<VERSION>]``. |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 123 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 124 | Clone master branch of keystone formula as local feature branch: |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 125 | |
| 126 | .. code-block:: yaml |
| 127 | |
| 128 | salt: |
| 129 | master: |
| 130 | enabled: true |
| 131 | ... |
| 132 | environment: |
| 133 | dev: |
| 134 | formula: |
| 135 | keystone: |
| 136 | source: git |
| 137 | address: git@github.com:openstack/salt-formula-keystone.git |
| 138 | revision: master |
| 139 | branch: feature |
| 140 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 141 | Salt master with specified formula refs (for example, for Gerrit |
| 142 | review): |
Adam Tengler | 3eb85ad | 2016-05-06 02:52:40 +0200 | [diff] [blame] | 143 | |
| 144 | .. code-block:: yaml |
| 145 | |
| 146 | salt: |
| 147 | master: |
| 148 | enabled: true |
| 149 | ... |
| 150 | environment: |
| 151 | dev: |
| 152 | formula: |
| 153 | keystone: |
| 154 | source: git |
| 155 | address: https://git.openstack.org/openstack/salt-formula-keystone |
| 156 | revision: refs/changes/56/123456/1 |
| 157 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 158 | Salt master logging configuration: |
Oleksii Chupryn | 7b7102a | 2018-05-11 10:32:11 +0300 | [diff] [blame] | 159 | |
| 160 | .. code-block:: yaml |
| 161 | |
| 162 | salt: |
| 163 | master: |
| 164 | enabled: true |
| 165 | log: |
| 166 | level: warning |
| 167 | file: '/var/log/salt/master' |
| 168 | level_logfile: warning |
| 169 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 170 | Salt minion logging configuration: |
Oleksii Chupryn | 7b7102a | 2018-05-11 10:32:11 +0300 | [diff] [blame] | 171 | |
| 172 | .. code-block:: yaml |
| 173 | |
| 174 | salt: |
| 175 | minion: |
| 176 | enabled: true |
| 177 | log: |
| 178 | level: info |
| 179 | file: '/var/log/salt/minion' |
| 180 | level_logfile: warning |
| 181 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 182 | Salt master with logging handlers: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 183 | |
| 184 | .. code-block:: yaml |
| 185 | |
| 186 | salt: |
| 187 | master: |
| 188 | enabled: true |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 189 | handler: |
| 190 | handler01: |
| 191 | engine: udp |
| 192 | bind: |
| 193 | host: 127.0.0.1 |
| 194 | port: 9999 |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 195 | minion: |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 196 | handler: |
| 197 | handler01: |
| 198 | engine: udp |
| 199 | bind: |
| 200 | host: 127.0.0.1 |
| 201 | port: 9999 |
| 202 | handler02: |
| 203 | engine: zmq |
| 204 | bind: |
| 205 | host: 127.0.0.1 |
| 206 | port: 9999 |
| 207 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 208 | Salt engine definition for saltgraph metadata collector: |
Ales Komarek | a9fc6e7 | 2017-09-06 15:02:40 +0200 | [diff] [blame] | 209 | |
| 210 | .. code-block:: yaml |
| 211 | |
| 212 | salt: |
| 213 | master: |
| 214 | engine: |
| 215 | graph_metadata: |
| 216 | engine: saltgraph |
| 217 | host: 127.0.0.1 |
| 218 | port: 5432 |
| 219 | user: salt |
| 220 | password: salt |
| 221 | database: salt |
| 222 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 223 | Salt engine definition for Architect service: |
Ales Komarek | 459407b | 2018-01-18 17:16:31 +0100 | [diff] [blame] | 224 | |
| 225 | .. code-block:: yaml |
| 226 | |
| 227 | salt: |
| 228 | master: |
| 229 | engine: |
| 230 | architect: |
| 231 | engine: architect |
| 232 | project: project-name |
| 233 | host: architect-api |
| 234 | port: 8181 |
| 235 | username: salt |
| 236 | password: password |
| 237 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 238 | Salt engine definition for sending events from docker events: |
Ales Komarek | a9fc6e7 | 2017-09-06 15:02:40 +0200 | [diff] [blame] | 239 | |
| 240 | .. code-block:: yaml |
| 241 | |
| 242 | salt: |
| 243 | master: |
| 244 | engine: |
| 245 | docker_events: |
| 246 | docker_url: unix://var/run/docker.sock |
| 247 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 248 | Salt master peer setup for remote certificate signing: |
Jakub Pavlik | d485984 | 2016-05-23 10:48:04 +0200 | [diff] [blame] | 249 | |
| 250 | .. code-block:: yaml |
| 251 | |
| 252 | salt: |
| 253 | master: |
| 254 | peer: |
| 255 | ".*": |
| 256 | - x509.sign_remote_certificate |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 257 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 258 | Salt master backup configuration: |
Ales Komarek | b2ada52 | 2017-12-07 11:31:32 +0100 | [diff] [blame] | 259 | |
| 260 | .. code-block:: yaml |
| 261 | |
| 262 | salt: |
| 263 | master: |
| 264 | backup: true |
| 265 | initial_data: |
| 266 | engine: backupninja |
Jiri Broulik | 3e28164 | 2018-03-02 18:17:21 +0100 | [diff] [blame] | 267 | home_dir: remote-backup-home-dir |
Ales Komarek | b2ada52 | 2017-12-07 11:31:32 +0100 | [diff] [blame] | 268 | source: backup-node-host |
| 269 | host: original-salt-master-id |
| 270 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 271 | Configure verbosity of state output (used for :command:`salt` |
| 272 | command): |
Tomáš Kukrál | 8922aef | 2017-05-10 10:27:04 +0200 | [diff] [blame] | 273 | |
| 274 | .. code-block:: yaml |
| 275 | |
| 276 | salt: |
| 277 | master: |
Tomáš Kukrál | 044667b | 2017-05-11 10:12:15 +0200 | [diff] [blame] | 278 | state_output: changes |
Tomáš Kukrál | 8922aef | 2017-05-10 10:27:04 +0200 | [diff] [blame] | 279 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 280 | Pass pillar render error to minion log: |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 281 | |
| 282 | .. note:: When set to `False` this option is great for debuging. |
| 283 | However it is not recomended for any production environment as it may contain |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 284 | templating data as passwords, and so on, that minion should not expose. |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 285 | |
| 286 | .. code-block:: yaml |
| 287 | |
| 288 | salt: |
| 289 | master: |
| 290 | pillar_safe_render_error: False |
| 291 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 292 | Enable Windows repository support: |
Ales Komarek | f44e64c | 2018-05-29 10:22:31 +0200 | [diff] [blame] | 293 | |
| 294 | .. code-block:: yaml |
| 295 | |
| 296 | salt: |
| 297 | master: |
| 298 | win_repo: |
| 299 | source: git |
| 300 | address: https://github.com/saltstack/salt-winrepo-ng |
| 301 | revision: master |
| 302 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 303 | Event/Reactor systems |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 304 | ~~~~~~~~~~~~~~~~~~~~~ |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 305 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 306 | Salt to synchronize node pillar and modules after start: |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 307 | |
| 308 | .. code-block:: yaml |
| 309 | |
| 310 | salt: |
| 311 | master: |
| 312 | reactor: |
| 313 | salt/minion/*/start: |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 314 | - salt://salt/reactor/node_start.sls |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 315 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 316 | Trigger basic node install: |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 317 | |
| 318 | .. code-block:: yaml |
| 319 | |
| 320 | salt: |
| 321 | master: |
| 322 | reactor: |
| 323 | salt/minion/install: |
| 324 | - salt://salt/reactor/node_install.sls |
| 325 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 326 | Sample event to trigger the node installation: |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 327 | |
| 328 | .. code-block:: bash |
| 329 | |
| 330 | salt-call event.send 'salt/minion/install' |
| 331 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 332 | Run any defined orchestration pipeline: |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 333 | |
| 334 | .. code-block:: yaml |
| 335 | |
| 336 | salt: |
| 337 | master: |
| 338 | reactor: |
| 339 | salt/orchestrate/start: |
| 340 | - salt://salt/reactor/orchestrate_start.sls |
| 341 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 342 | Event to trigger the orchestration pipeline: |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 343 | |
| 344 | .. code-block:: bash |
| 345 | |
Ales Komarek | e7844d1 | 2017-06-08 12:00:01 +0200 | [diff] [blame] | 346 | 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] | 347 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 348 | Synchronise modules and pillars on minion start: |
Ales Komarek | 3ed7c43 | 2017-08-24 16:15:49 +0200 | [diff] [blame] | 349 | |
| 350 | .. code-block:: yaml |
| 351 | |
| 352 | salt: |
| 353 | master: |
| 354 | reactor: |
| 355 | 'salt/minion/*/start': |
| 356 | - salt://salt/reactor/minion_start.sls |
| 357 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 358 | Add and/or remove the minion key: |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 359 | |
| 360 | .. code-block:: yaml |
| 361 | |
| 362 | salt: |
| 363 | master: |
| 364 | reactor: |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 365 | salt/key/create: |
| 366 | - salt://salt/reactor/key_create.sls |
| 367 | salt/key/remove: |
| 368 | - salt://salt/reactor/key_remove.sls |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 369 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 370 | Event to trigger the key creation: |
Ales Komarek | 5c58de3 | 2017-06-06 11:49:32 +0200 | [diff] [blame] | 371 | |
| 372 | .. code-block:: bash |
| 373 | |
Adam Tengler | 6218896 | 2017-09-04 13:34:44 +0000 | [diff] [blame] | 374 | salt-call event.send 'salt/key/create' \ |
| 375 | > "{'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] | 376 | |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 377 | .. note:: |
| 378 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 379 | You can add pass additional ``orch_pre_create``, ``orch_post_create``, |
| 380 | ``orch_pre_remove`` or ``orch_post_remove`` parameters to the event |
| 381 | to call extra orchestrate files. This can be useful for example for |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 382 | registering/unregistering nodes from the monitoring alarms or dashboards. |
| 383 | |
| 384 | The key creation event needs to be run from other machine than the one |
| 385 | being registered. |
| 386 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 387 | Event to trigger the key removal: |
Ales Komarek | 213fbe0 | 2017-08-21 16:39:05 +0200 | [diff] [blame] | 388 | |
| 389 | .. code-block:: bash |
| 390 | |
| 391 | salt-call event.send 'salt/key/remove' |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 392 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 393 | Control VM provisioning: |
Dzmitry Stremkouski | 7ee2340 | 2018-04-10 00:43:48 +0200 | [diff] [blame] | 394 | |
| 395 | .. code-block:: yaml |
| 396 | |
| 397 | virt: |
| 398 | disk: |
| 399 | three_disks: |
| 400 | - system: |
| 401 | size: 4096 |
| 402 | image: ubuntu.qcow |
| 403 | - repository_snapshot: |
| 404 | size: 8192 |
| 405 | image: snapshot.qcow |
| 406 | - cinder-volume: |
| 407 | size: 2048 |
Ondrej Smola | e6bcb29 | 2018-04-13 10:56:39 +0200 | [diff] [blame] | 408 | nic: |
| 409 | control: |
| 410 | - name: nic01 |
| 411 | bridge: br-pxe |
| 412 | model: virtio |
| 413 | - name: nic02 |
| 414 | bridge: br-cp |
| 415 | model: virtio |
| 416 | - name: nic03 |
| 417 | bridge: br-store-front |
| 418 | model: virtio |
| 419 | - name: nic04 |
| 420 | bridge: br-public |
| 421 | model: virtio |
Dzmitry Stremkouski | b8acf1f | 2018-06-28 12:56:23 +0200 | [diff] [blame] | 422 | - name: nic05 |
| 423 | bridge: br-prv |
| 424 | model: virtio |
| 425 | virtualport: |
| 426 | type: openvswitch |
Ondrej Smola | e6bcb29 | 2018-04-13 10:56:39 +0200 | [diff] [blame] | 427 | |
Dzmitry Stremkouski | 7ee2340 | 2018-04-10 00:43:48 +0200 | [diff] [blame] | 428 | salt: |
| 429 | control: |
| 430 | enabled: true |
| 431 | virt_enabled: true |
| 432 | size: |
| 433 | medium_three_disks: |
| 434 | cpu: 2 |
| 435 | ram: 4 |
| 436 | disk_profile: three_disks |
| 437 | cluster: |
| 438 | mycluster: |
| 439 | domain: neco.virt.domain.com |
| 440 | engine: virt |
Ondrej Smola | c7f6cfc | 2018-05-21 15:55:08 +0200 | [diff] [blame] | 441 | #Option to set rng globaly |
| 442 | rng: false |
Dzmitry Stremkouski | 7ee2340 | 2018-04-10 00:43:48 +0200 | [diff] [blame] | 443 | node: |
| 444 | ubuntu1: |
| 445 | provider: node01.domain.com |
| 446 | image: ubuntu.qcow |
| 447 | size: medium |
| 448 | img_dest: /var/lib/libvirt/ssdimages |
Ondrej Smola | c7f6cfc | 2018-05-21 15:55:08 +0200 | [diff] [blame] | 449 | #Rng defined on node will have higher priority then global one |
Dzmitry Stremkouski | 7ee2340 | 2018-04-10 00:43:48 +0200 | [diff] [blame] | 450 | rng: |
| 451 | backend: /dev/urandom |
| 452 | model: random |
| 453 | rate: |
| 454 | period: '1800' |
| 455 | bytes: '1500' |
Ondrej Smola | e6bcb29 | 2018-04-13 10:56:39 +0200 | [diff] [blame] | 456 | mac: |
| 457 | nic01: AC:DE:48:AA:AA:AA |
| 458 | nic02: AC:DE:48:AA:AA:BB |
| 459 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 460 | To enable Redis plugin for the Salt caching subsystem, use the |
| 461 | below pillar structure: |
Oleh Hryhorov | ca6b917 | 2018-06-21 14:21:35 +0000 | [diff] [blame] | 462 | |
| 463 | .. code-block:: yaml |
| 464 | |
| 465 | salt: |
| 466 | master: |
| 467 | cache: |
| 468 | plugin: redis |
| 469 | host: localhost |
| 470 | port: 6379 |
| 471 | db: '0' |
| 472 | password: pass_word |
| 473 | bank_prefix: 'MCP' |
| 474 | bank_keys_prefix: 'MCPKEY' |
| 475 | key_prefix: 'KEY' |
| 476 | separator: '@' |
Ondrej Smola | e6bcb29 | 2018-04-13 10:56:39 +0200 | [diff] [blame] | 477 | |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 478 | Jinja options |
| 479 | ------------- |
| 480 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 481 | Use the following options to update default Jinja renderer options. |
| 482 | Salt recognize Jinja options for templates and for the ``sls`` files. |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 483 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 484 | For full list of options, see Jinja documentation: |
| 485 | http://jinja.pocoo.org/docs/api/#high-level-api |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 486 | |
| 487 | .. code-block:: yaml |
| 488 | |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 489 | salt: |
| 490 | renderer: |
| 491 | # for templates |
| 492 | jinja: &jina_env |
| 493 | # Default Jinja environment options |
| 494 | block_start_string: '{%' |
| 495 | block_end_string: '%}' |
| 496 | variable_start_string: '{{' |
| 497 | variable_end_string: '}}' |
| 498 | comment_start_string: '{#' |
| 499 | comment_end_string: '#}' |
| 500 | keep_trailing_newline: False |
| 501 | newline_sequence: '\n' |
| 502 | |
| 503 | # Next two are enabled by default in Salt |
| 504 | trim_blocks: True |
| 505 | lstrip_blocks: True |
| 506 | |
| 507 | # Next two are not enabled by default in Salt |
| 508 | # but worth to consider to enable in future for salt-formulas |
| 509 | line_statement_prefix: '%' |
| 510 | line_comment_prefix: '##' |
| 511 | |
| 512 | # for .sls state files |
| 513 | jinja_sls: *jinja_env |
| 514 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 515 | With the ``line_statement/comment* _prefix`` options enabled following |
| 516 | code statements are valid: |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 517 | |
| 518 | .. code-block:: yaml |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 519 | |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 520 | %- set myvar = 'one' |
| 521 | |
| 522 | ## You can mix even with '{%' |
| 523 | {%- set myvar = 'two' %} ## comment |
| 524 | %- set mylist = ['one', 'two', 'three'] ## comment |
| 525 | |
| 526 | ## comment |
| 527 | %- for item in mylist: ## comment |
| 528 | {{- item }} |
| 529 | %- endfor |
| 530 | |
Petr Michalec | df75d68 | 2018-02-07 13:43:53 +0100 | [diff] [blame] | 531 | Encrypted pillars |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 532 | ~~~~~~~~~~~~~~~~~ |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 533 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 534 | .. note:: NACL and the below configuration will be available in Salt > 2017.7. |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 535 | |
| 536 | External resources: |
| 537 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 538 | - Tutorial to configure the Salt and Reclass ``ext_pillar`` and NACL: |
| 539 | http://apealive.net/post/2017-09-salt-nacl-ext-pillar/ |
| 540 | - SaltStack documentation: |
| 541 | https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.nacl.html |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 542 | |
| 543 | Configure salt NACL module: |
| 544 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 545 | .. code-block:: bash |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 546 | |
| 547 | pip install --upgrade libnacl===1.5.2 |
| 548 | salt-call --local nacl.keygen /etc/salt/pki/master/nacl |
| 549 | |
| 550 | local: |
| 551 | saved sk_file:/etc/salt/pki/master/nacl pk_file: /etc/salt/pki/master/nacl.pub |
| 552 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 553 | .. code-block:: yaml |
| 554 | |
| 555 | salt: |
| 556 | master: |
| 557 | pillar: |
| 558 | reclass: *reclass |
| 559 | nacl: |
| 560 | index: 99 |
| 561 | nacl: |
| 562 | box_type: sealedbox |
| 563 | sk_file: /etc/salt/pki/master/nacl |
| 564 | pk_file: /etc/salt/pki/master/nacl.pub |
| 565 | #sk: None |
| 566 | #pk: None |
| 567 | |
| 568 | NACL encrypt secrets: |
| 569 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 570 | .. code-block:: bash |
| 571 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 572 | salt-call --local nacl.enc 'my_secret_value' pk_file=/etc/salt/pki/master/nacl.pub |
| 573 | hXTkJpC1hcKMS7yZVGESutWrkvzusXfETXkacSklIxYjfWDlMJmR37MlmthdIgjXpg4f2AlBKb8tc9Woma7q |
| 574 | # or |
| 575 | salt-run nacl.enc 'myotherpass' |
| 576 | ADDFD0Rav6p6+63sojl7Htfrncp5rrDVyeE4BSPO7ipq8fZuLDIVAzQLf4PCbDqi+Fau5KD3/J/E+Pw= |
| 577 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 578 | NACL encrypted values on pillar: |
| 579 | |
| 580 | Use Boxed syntax `NACL[CryptedValue=]` to encode value on pillar: |
| 581 | |
| 582 | .. code-block:: yaml |
| 583 | |
| 584 | my_pillar: |
| 585 | my_nacl: |
| 586 | key0: unencrypted_value |
| 587 | key1: NACL[hXTkJpC1hcKMS7yZVGESutWrkvzusXfETXkacSklIxYjfWDlMJmR37MlmthdIgjXpg4f2AlBKb8tc9Woma7q] |
| 588 | |
| 589 | NACL large files: |
| 590 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 591 | .. code-block:: bash |
| 592 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 593 | salt-call nacl.enc_file /tmp/cert.crt out=/srv/salt/env/dev/cert.nacl |
| 594 | # or more advanced |
| 595 | cert=$(cat /tmp/cert.crt) |
| 596 | salt-call --out=newline_values_only nacl.enc_pub data="$cert" > /srv/salt/env/dev/cert.nacl |
| 597 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 598 | NACL within template/native pillars: |
| 599 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 600 | .. code-block:: yaml |
| 601 | |
Petr Michalec | 1f541c4 | 2017-08-17 13:30:37 +0200 | [diff] [blame] | 602 | pillarexample: |
| 603 | user: root |
| 604 | password1: {{salt.nacl.dec('DRB7Q6/X5gGSRCTpZyxS6hlbWj0llUA+uaVyvou3vJ4=')|json}} |
| 605 | cert_key: {{salt.nacl.dec_file('/srv/salt/env/dev/certs/example.com/cert.nacl')|json}} |
| 606 | cert_key2: {{salt.nacl.dec_file('salt:///certs/example.com/cert2.nacl')|json}} |
| 607 | |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 608 | Salt Syndic |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 609 | ----------- |
| 610 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 611 | The master of masters: |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 612 | |
| 613 | .. code-block:: yaml |
| 614 | |
| 615 | salt: |
| 616 | master: |
| 617 | enabled: true |
| 618 | order_masters: True |
| 619 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 620 | Lower syndicated master: |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 621 | |
| 622 | .. code-block:: yaml |
| 623 | |
| 624 | salt: |
| 625 | syndic: |
| 626 | enabled: true |
| 627 | master: |
| 628 | host: master-of-master-host |
| 629 | timeout: 5 |
| 630 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 631 | Syndicated master with multiple master of masters: |
Ales Komarek | 5474068 | 2017-05-15 07:16:23 +0200 | [diff] [blame] | 632 | |
| 633 | .. code-block:: yaml |
| 634 | |
| 635 | salt: |
| 636 | syndic: |
| 637 | enabled: true |
| 638 | masters: |
| 639 | - host: master-of-master-host1 |
| 640 | - host: master-of-master-host2 |
| 641 | timeout: 5 |
| 642 | |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 643 | Salt Minion |
| 644 | ----------- |
| 645 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 646 | Minion ID by default triggers dependency on Linux formula, as it uses fqdn |
| 647 | configured from `linux.system.name` and `linux.system.domain` pillar. |
| 648 | To override, provide exact minion ID you require. The same can be set for |
| 649 | master ID rendered at ``master.conf``. |
Petr Michalec | cfd93e1 | 2018-06-26 18:11:44 +0200 | [diff] [blame] | 650 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 651 | .. code-block:: yaml |
Petr Michalec | cfd93e1 | 2018-06-26 18:11:44 +0200 | [diff] [blame] | 652 | |
| 653 | salt: |
| 654 | minion: |
| 655 | id: minion1.production |
| 656 | master: |
| 657 | id: master.production |
| 658 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 659 | Simplest Salt minion setup with central configuration node: |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 660 | |
| 661 | .. literalinclude:: tests/pillar/minion_master.sls |
| 662 | :language: yaml |
| 663 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 664 | Multi-master Salt minion setup: |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 665 | |
| 666 | .. literalinclude:: tests/pillar/minion_multi_master.sls |
| 667 | :language: yaml |
| 668 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 669 | Salt minion with salt mine options: |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 670 | |
| 671 | .. literalinclude:: tests/pillar/minion_mine.sls |
| 672 | :language: yaml |
| 673 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 674 | Salt minion with graphing dependencies: |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 675 | |
| 676 | .. literalinclude:: tests/pillar/minion_graph.sls |
| 677 | :language: yaml |
| 678 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 679 | Salt minion behind HTTP proxy: |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 680 | |
| 681 | .. code-block:: yaml |
| 682 | |
| 683 | salt: |
| 684 | minion: |
| 685 | proxy: |
| 686 | host: 127.0.0.1 |
| 687 | port: 3128 |
| 688 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 689 | Salt minion to specify non-default HTTP backend. The default |
| 690 | tornado backend does not respect HTTP proxy settings set as |
| 691 | environment variables. This is useful for cases where you need |
| 692 | to set no_proxy lists. |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 693 | |
| 694 | .. code-block:: yaml |
| 695 | |
| 696 | salt: |
| 697 | minion: |
| 698 | backend: urllib2 |
| 699 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 700 | Salt minion with PKI certificate authority (CA): |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 701 | |
| 702 | .. literalinclude:: tests/pillar/minion_pki_ca.sls |
| 703 | :language: yaml |
| 704 | |
| 705 | Salt minion using PKI certificate |
| 706 | |
| 707 | .. literalinclude:: tests/pillar/minion_pki_cert.sls |
| 708 | :language: yaml |
| 709 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 710 | Salt minion trust CA certificates issued by salt CA on a |
| 711 | specific host (ie: salt-master node): |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 712 | |
| 713 | .. code-block:: yaml |
| 714 | |
| 715 | salt: |
| 716 | minion: |
| 717 | trusted_ca_minions: |
| 718 | - cfg01 |
| 719 | |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 720 | Salt Minion Proxy |
| 721 | ~~~~~~~~~~~~~~~~~ |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 722 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 723 | Salt proxy pillar: |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 724 | |
| 725 | .. code-block:: yaml |
| 726 | |
| 727 | salt: |
| 728 | minion: |
Jiri Broulik | 8827524 | 2017-05-24 17:21:17 +0200 | [diff] [blame] | 729 | proxy_minion: |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 730 | master: localhost |
| 731 | device: |
| 732 | vsrx01.mydomain.local: |
| 733 | enabled: true |
| 734 | engine: napalm |
| 735 | csr1000v.mydomain.local: |
| 736 | enabled: true |
| 737 | engine: napalm |
| 738 | |
| 739 | .. note:: This is pillar of the the real salt-minion |
| 740 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 741 | Proxy pillar for IOS device: |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 742 | |
| 743 | .. code-block:: yaml |
| 744 | |
| 745 | proxy: |
| 746 | proxytype: napalm |
| 747 | driver: ios |
| 748 | host: csr1000v.mydomain.local |
| 749 | username: root |
| 750 | passwd: r00tme |
| 751 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 752 | .. note:: This is pillar of the node thats not able to run |
| 753 | salt-minion itself. |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 754 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 755 | Proxy pillar for JunOS device: |
Jiri Broulik | a0f4668 | 2017-04-20 22:45:01 +0200 | [diff] [blame] | 756 | |
| 757 | .. code-block:: yaml |
| 758 | |
| 759 | proxy: |
| 760 | proxytype: napalm |
| 761 | driver: junos |
| 762 | host: vsrx01.mydomain.local |
| 763 | username: root |
| 764 | passwd: r00tme |
| 765 | optional_args: |
| 766 | config_format: set |
| 767 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 768 | .. note:: This pillar applies to the node that can not run |
| 769 | salt-minion itself. |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 770 | |
| 771 | Salt SSH |
Ales Komarek | d768f1c | 2018-01-30 22:37:18 +0100 | [diff] [blame] | 772 | ~~~~~~~~ |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 773 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 774 | Salt SSH with sudoer using key: |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 775 | |
| 776 | .. literalinclude:: tests/pillar/master_ssh_minion_key.sls |
| 777 | :language: yaml |
| 778 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 779 | Salt SSH with sudoer using password: |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 780 | |
| 781 | .. literalinclude:: tests/pillar/master_ssh_minion_password.sls |
| 782 | :language: yaml |
| 783 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 784 | Salt SSH with root using password: |
Ales Komarek | 8fb1da8 | 2016-08-21 23:52:03 +0200 | [diff] [blame] | 785 | |
| 786 | .. literalinclude:: tests/pillar/master_ssh_minion_root.sls |
| 787 | :language: yaml |
| 788 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 789 | Salt control (cloud/kvm/docker) |
| 790 | ------------------------------- |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 791 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 792 | Salt cloud with local OpenStack provider: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 793 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 794 | .. literalinclude:: tests/pillar/control_cloud_openstack.sls |
| 795 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 796 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 797 | Salt cloud with Digital Ocean provider: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 798 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 799 | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls |
| 800 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 801 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 802 | Salt virt with KVM cluster: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 803 | |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 804 | .. literalinclude:: tests/pillar/control_virt.sls |
| 805 | :language: yaml |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 806 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 807 | Salt virt with custom destination for image file: |
Mateusz Los | 4c7cd2d | 2018-01-09 11:46:07 +0100 | [diff] [blame] | 808 | |
| 809 | .. literalinclude:: tests/pillar/control_virt_custom.sls |
| 810 | :language: yaml |
| 811 | |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 812 | Usage |
| 813 | ===== |
| 814 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 815 | Working with salt-cloud: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 816 | |
| 817 | .. code-block:: bash |
| 818 | |
| 819 | salt-cloud -m /path/to/map --assume-yes |
| 820 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 821 | Debug LIBCLOUD for salt-cloud connection: |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 822 | |
| 823 | .. code-block:: bash |
| 824 | |
| 825 | export LIBCLOUD_DEBUG=/dev/stderr; salt-cloud --list-sizes provider_name --log-level all |
| 826 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 827 | Read more |
| 828 | ========= |
Filip Pytloun | b4b8059 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 829 | |
| 830 | * http://salt.readthedocs.org/en/latest/ |
| 831 | * https://github.com/DanielBryan/salt-state-graph |
| 832 | * http://karlgrz.com/testing-salt-states-rapidly-with-docker/ |
| 833 | * https://mywushublog.com/2013/03/configuration-management-with-salt-stack/ |
| 834 | * http://russell.ballestrini.net/replace-the-nagios-scheduler-and-nrpe-with-salt-stack/ |
| 835 | * https://github.com/saltstack-formulas/salt-formula |
| 836 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
| 837 | |
| 838 | salt-cloud |
| 839 | ---------- |
| 840 | |
| 841 | * http://www.blog.sandro-mathys.ch/2013/07/setting-user-password-when-launching.html |
| 842 | * http://cloudinit.readthedocs.org/en/latest/topics/examples.html |
| 843 | * http://salt-cloud.readthedocs.org/en/latest/topics/install/index.html |
| 844 | * http://docs.saltstack.com/topics/cloud/digitalocean.html |
| 845 | * http://salt-cloud.readthedocs.org/en/latest/topics/rackspace.html |
| 846 | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html |
| 847 | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html |
Ales Komarek | 8ba9c0b | 2016-02-21 14:59:59 +0100 | [diff] [blame] | 848 | |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 849 | Documentation and Bugs |
| 850 | ====================== |
| 851 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 852 | * http://salt-formulas.readthedocs.io/ |
| 853 | Learn how to install and update salt-formulas |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 854 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 855 | * https://github.com/salt-formulas/salt-formula-salt/issues |
| 856 | In the unfortunate event that bugs are discovered, report the issue to the |
| 857 | appropriate issue tracker. Use the Github issue tracker for a specific salt |
| 858 | formula |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 859 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 860 | * https://launchpad.net/salt-formulas |
| 861 | For feature requests, bug reports, or blueprints affecting the entire |
| 862 | ecosystem, use the Launchpad salt-formulas project |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 863 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 864 | * https://launchpad.net/~salt-formulas-users |
| 865 | Join the salt-formulas-users team and subscribe to mailing list if required |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 866 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 867 | * https://github.com/salt-formulas/salt-formula-salt |
| 868 | Develop the salt-formulas projects in the master branch and then submit pull |
| 869 | requests against a specific formula |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 870 | |
OlgaGusarenko | f1fd82e | 2018-07-31 01:20:49 +0300 | [diff] [blame] | 871 | * #salt-formulas @ irc.freenode.net |
| 872 | Use this IRC channel in case of any questions or feedback which is always |
| 873 | welcome |
Filip Pytloun | 954dbd6 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 874 | |