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