Aleš Komárek | 6357299 | 2017-04-11 13:16:44 +0200 | [diff] [blame] | 1 | ============ |
| 2 | Linux Fomula |
| 3 | ============ |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 4 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 5 | Linux Operating Systems: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 6 | |
| 7 | * Ubuntu |
| 8 | * CentOS |
| 9 | * RedHat |
| 10 | * Fedora |
| 11 | * Arch |
| 12 | |
Aleš Komárek | 6357299 | 2017-04-11 13:16:44 +0200 | [diff] [blame] | 13 | Sample Pillars |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 14 | ============== |
| 15 | |
Aleš Komárek | 6357299 | 2017-04-11 13:16:44 +0200 | [diff] [blame] | 16 | Linux System |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 17 | ------------ |
| 18 | |
| 19 | Basic Linux box |
| 20 | |
| 21 | .. code-block:: yaml |
| 22 | |
| 23 | linux: |
| 24 | system: |
| 25 | enabled: true |
| 26 | name: 'node1' |
| 27 | domain: 'domain.com' |
| 28 | cluster: 'system' |
| 29 | environment: prod |
| 30 | timezone: 'Europe/Prague' |
| 31 | utc: true |
| 32 | |
azvyagintsev | 967af13 | 2017-06-12 12:25:24 +0300 | [diff] [blame] | 33 | Linux with system users, some with password set: |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 34 | |
| 35 | .. warning:: If no ``password`` variable is passed, |
| 36 | any predifined password will be removed. |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 37 | |
| 38 | .. code-block:: yaml |
| 39 | |
| 40 | linux: |
| 41 | system: |
| 42 | ... |
| 43 | user: |
| 44 | jdoe: |
| 45 | name: 'jdoe' |
| 46 | enabled: true |
| 47 | sudo: true |
| 48 | shell: /bin/bash |
| 49 | full_name: 'Jonh Doe' |
| 50 | home: '/home/jdoe' |
Martin Polreich | 4fcd5c0 | 2018-07-16 09:41:51 +0200 | [diff] [blame] | 51 | home_dir_mode: 755 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 52 | email: 'jonh@doe.com' |
| 53 | jsmith: |
| 54 | name: 'jsmith' |
| 55 | enabled: true |
azvyagintsev | 967af13 | 2017-06-12 12:25:24 +0300 | [diff] [blame] | 56 | full_name: 'With clear password' |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 57 | home: '/home/jsmith' |
azvyagintsev | 967af13 | 2017-06-12 12:25:24 +0300 | [diff] [blame] | 58 | hash_password: true |
| 59 | password: "userpassword" |
| 60 | mark: |
| 61 | name: 'mark' |
| 62 | enabled: true |
| 63 | full_name: "unchange password' |
| 64 | home: '/home/mark' |
| 65 | password: false |
| 66 | elizabeth: |
| 67 | name: 'elizabeth' |
| 68 | enabled: true |
| 69 | full_name: 'With hased password' |
| 70 | home: '/home/elizabeth' |
| 71 | password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10" |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 72 | |
Petr Michalec | 1c4c8d8 | 2017-02-28 19:09:21 +0100 | [diff] [blame] | 73 | Configure sudo for users and groups under ``/etc/sudoers.d/``. |
| 74 | This ways ``linux.system.sudo`` pillar map to actual sudo attributes: |
| 75 | |
| 76 | .. code-block:: jinja |
Aleš Komárek | 6357299 | 2017-04-11 13:16:44 +0200 | [diff] [blame] | 77 | |
Petr Michalec | 1c4c8d8 | 2017-02-28 19:09:21 +0100 | [diff] [blame] | 78 | # simplified template: |
| 79 | Cmds_Alias {{ alias }}={{ commands }} |
| 80 | {{ user }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }} |
| 81 | %{{ group }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }} |
| 82 | |
| 83 | # when rendered: |
| 84 | saltuser1 ALL=(ALL) NOPASSWD: ALL |
| 85 | |
Petr Michalec | 1c4c8d8 | 2017-02-28 19:09:21 +0100 | [diff] [blame] | 86 | .. code-block:: yaml |
Aleš Komárek | 6357299 | 2017-04-11 13:16:44 +0200 | [diff] [blame] | 87 | |
Petr Michalec | 1c4c8d8 | 2017-02-28 19:09:21 +0100 | [diff] [blame] | 88 | linux: |
| 89 | system: |
| 90 | sudo: |
| 91 | enabled: true |
Tomas Kamm | d8eb300 | 2017-05-08 19:30:29 +0200 | [diff] [blame] | 92 | aliases: |
Petr Michalec | 1c4c8d8 | 2017-02-28 19:09:21 +0100 | [diff] [blame] | 93 | host: |
| 94 | LOCAL: |
| 95 | - localhost |
| 96 | PRODUCTION: |
| 97 | - db1 |
| 98 | - db2 |
| 99 | runas: |
| 100 | DBA: |
| 101 | - postgres |
| 102 | - mysql |
| 103 | SALT: |
| 104 | - root |
| 105 | command: |
| 106 | # Note: This is not 100% safe when ALL keyword is used, user still may modify configs and hide his actions. |
| 107 | # Best practice is to specify full list of commands user is allowed to run. |
| 108 | SUPPORT_RESTRICTED: |
| 109 | - /bin/vi /etc/sudoers* |
| 110 | - /bin/vim /etc/sudoers* |
| 111 | - /bin/nano /etc/sudoers* |
| 112 | - /bin/emacs /etc/sudoers* |
| 113 | - /bin/su - root |
| 114 | - /bin/su - |
| 115 | - /bin/su |
| 116 | - /usr/sbin/visudo |
| 117 | SUPPORT_SHELLS: |
| 118 | - /bin/sh |
| 119 | - /bin/ksh |
| 120 | - /bin/bash |
| 121 | - /bin/rbash |
| 122 | - /bin/dash |
| 123 | - /bin/zsh |
| 124 | - /bin/csh |
| 125 | - /bin/fish |
| 126 | - /bin/tcsh |
| 127 | - /usr/bin/login |
| 128 | - /usr/bin/su |
| 129 | - /usr/su |
| 130 | ALL_SALT_SAFE: |
| 131 | - /usr/bin/salt state* |
| 132 | - /usr/bin/salt service* |
| 133 | - /usr/bin/salt pillar* |
| 134 | - /usr/bin/salt grains* |
| 135 | - /usr/bin/salt saltutil* |
| 136 | - /usr/bin/salt-call state* |
| 137 | - /usr/bin/salt-call service* |
| 138 | - /usr/bin/salt-call pillar* |
| 139 | - /usr/bin/salt-call grains* |
| 140 | - /usr/bin/salt-call saltutil* |
| 141 | SALT_TRUSTED: |
| 142 | - /usr/bin/salt* |
| 143 | users: |
| 144 | # saltuser1 with default values: saltuser1 ALL=(ALL) NOPASSWD: ALL |
| 145 | saltuser1: {} |
| 146 | saltuser2: |
| 147 | hosts: |
| 148 | - LOCAL |
| 149 | # User Alias DBA |
| 150 | DBA: |
| 151 | hosts: |
| 152 | - ALL |
| 153 | commands: |
| 154 | - ALL_SALT_SAFE |
| 155 | groups: |
| 156 | db-ops: |
| 157 | hosts: |
| 158 | - ALL |
| 159 | - '!PRODUCTION' |
| 160 | runas: |
| 161 | - DBA |
| 162 | commands: |
| 163 | - /bin/cat * |
| 164 | - /bin/less * |
| 165 | - /bin/ls * |
| 166 | salt-ops: |
| 167 | hosts: |
| 168 | - 'ALL' |
| 169 | runas: |
| 170 | - SALT |
| 171 | commands: |
| 172 | - SUPPORT_SHELLS |
| 173 | salt-ops-2nd: |
| 174 | name: salt-ops |
| 175 | nopasswd: false |
Jakub Josef | 7a9d9b9 | 2017-05-16 11:39:01 +0200 | [diff] [blame] | 176 | setenv: true # Enable sudo -E option |
Petr Michalec | 1c4c8d8 | 2017-02-28 19:09:21 +0100 | [diff] [blame] | 177 | runas: |
| 178 | - DBA |
| 179 | commands: |
| 180 | - ALL |
| 181 | - '!SUPPORT_SHELLS' |
| 182 | - '!SUPPORT_RESTRICTED' |
| 183 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 184 | Linux with package, latest version: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 185 | |
| 186 | .. code-block:: yaml |
| 187 | |
| 188 | linux: |
| 189 | system: |
| 190 | ... |
| 191 | package: |
| 192 | package-name: |
| 193 | version: latest |
| 194 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 195 | Linux with package from certail repo, version with no upgrades: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 196 | |
| 197 | .. code-block:: yaml |
| 198 | |
| 199 | linux: |
| 200 | system: |
| 201 | ... |
| 202 | package: |
| 203 | package-name: |
| 204 | version: 2132.323 |
| 205 | repo: 'custom-repo' |
| 206 | hold: true |
| 207 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 208 | Linux with package from certail repo, version with no GPG |
| 209 | verification: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 210 | |
| 211 | .. code-block:: yaml |
| 212 | |
| 213 | linux: |
| 214 | system: |
| 215 | ... |
| 216 | package: |
| 217 | package-name: |
| 218 | version: 2132.323 |
| 219 | repo: 'custom-repo' |
| 220 | verify: false |
| 221 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 222 | Linux with autoupdates (automatically install security package |
| 223 | updates): |
Bruno Binet | 69a9d8d | 2017-02-16 22:34:32 +0100 | [diff] [blame] | 224 | |
| 225 | .. code-block:: yaml |
| 226 | |
| 227 | linux: |
| 228 | system: |
| 229 | ... |
| 230 | autoupdates: |
| 231 | enabled: true |
| 232 | mail: root@localhost |
| 233 | mail_only_on_error: true |
| 234 | remove_unused_dependencies: false |
| 235 | automatic_reboot: true |
| 236 | automatic_reboot_time: "02:00" |
| 237 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 238 | Linux with cron jobs |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 239 | |
| 240 | By default, it will use name as an identifier, unless identifier key is |
Filip Pytloun | 9122222 | 2017-08-04 10:55:27 +0200 | [diff] [blame] | 241 | explicitly set or False (then it will use Salt's default behavior which is |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 242 | identifier same as command resulting in not being able to change it): |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 243 | |
| 244 | .. code-block:: yaml |
| 245 | |
| 246 | linux: |
| 247 | system: |
| 248 | ... |
| 249 | job: |
| 250 | cmd1: |
| 251 | command: '/cmd/to/run' |
Filip Pytloun | 9122222 | 2017-08-04 10:55:27 +0200 | [diff] [blame] | 252 | identifier: cmd1 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 253 | enabled: true |
| 254 | user: 'root' |
| 255 | hour: 2 |
| 256 | minute: 0 |
| 257 | |
Filip Pytloun | d0a29e7 | 2015-11-30 15:23:34 +0100 | [diff] [blame] | 258 | Linux security limits (limit sensu user memory usage to max 1GB): |
| 259 | |
| 260 | .. code-block:: yaml |
| 261 | |
| 262 | linux: |
| 263 | system: |
| 264 | ... |
| 265 | limit: |
| 266 | sensu: |
| 267 | enabled: true |
| 268 | domain: sensu |
| 269 | limits: |
| 270 | - type: hard |
| 271 | item: as |
| 272 | value: 1000000 |
| 273 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 274 | Enable autologin on ``tty1`` (may work only for Ubuntu 14.04): |
Filip Pytloun | 7fee054 | 2015-10-15 11:19:24 +0200 | [diff] [blame] | 275 | |
| 276 | .. code-block:: yaml |
| 277 | |
| 278 | linux: |
| 279 | system: |
| 280 | console: |
| 281 | tty1: |
| 282 | autologin: root |
Filip Pytloun | 281d020 | 2016-01-29 14:03:51 +0100 | [diff] [blame] | 283 | # Enable serial console |
| 284 | ttyS0: |
| 285 | autologin: root |
| 286 | rate: 115200 |
| 287 | term: xterm |
Filip Pytloun | 7fee054 | 2015-10-15 11:19:24 +0200 | [diff] [blame] | 288 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 289 | To disable set autologin to ``false``. |
Filip Pytloun | 7fee054 | 2015-10-15 11:19:24 +0200 | [diff] [blame] | 290 | |
Filip Pytloun | 7731b85 | 2016-02-01 11:13:47 +0100 | [diff] [blame] | 291 | Set ``policy-rc.d`` on Debian-based systems. Action can be any available |
| 292 | command in ``while true`` loop and ``case`` context. |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 293 | Following will disallow dpkg to stop/start services for the Cassandra |
| 294 | package automatically: |
Filip Pytloun | 7731b85 | 2016-02-01 11:13:47 +0100 | [diff] [blame] | 295 | |
| 296 | .. code-block:: yaml |
| 297 | |
| 298 | linux: |
| 299 | system: |
| 300 | policyrcd: |
| 301 | - package: cassandra |
| 302 | action: exit 101 |
| 303 | - package: '*' |
| 304 | action: switch |
| 305 | |
Filip Pytloun | c49445a | 2016-04-04 14:23:20 +0200 | [diff] [blame] | 306 | Set system locales: |
| 307 | |
| 308 | .. code-block:: yaml |
| 309 | |
| 310 | linux: |
| 311 | system: |
| 312 | locale: |
| 313 | en_US.UTF-8: |
| 314 | default: true |
Filip Pytloun | ee1745f | 2016-04-04 17:39:41 +0200 | [diff] [blame] | 315 | "cs_CZ.UTF-8 UTF-8": |
Filip Pytloun | c49445a | 2016-04-04 14:23:20 +0200 | [diff] [blame] | 316 | enabled: true |
| 317 | |
Andrey Shestakov | e7cca05 | 2017-05-24 23:06:24 +0300 | [diff] [blame] | 318 | Systemd settings: |
| 319 | |
| 320 | .. code-block:: yaml |
| 321 | |
| 322 | linux: |
| 323 | system: |
| 324 | ... |
| 325 | systemd: |
| 326 | system: |
| 327 | Manager: |
| 328 | DefaultLimitNOFILE: 307200 |
| 329 | DefaultLimitNPROC: 307200 |
| 330 | user: |
| 331 | Manager: |
| 332 | DefaultLimitCPU: 2 |
| 333 | DefaultLimitNPROC: 4 |
| 334 | |
Filip Pytloun | 8b2131e | 2017-11-08 13:29:03 +0100 | [diff] [blame] | 335 | Ensure presence of directory: |
| 336 | |
| 337 | .. code-block:: yaml |
| 338 | |
| 339 | linux: |
| 340 | system: |
| 341 | directory: |
| 342 | /tmp/test: |
| 343 | user: root |
| 344 | group: root |
| 345 | mode: 700 |
| 346 | makedirs: true |
| 347 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 348 | Ensure presence of file by specifying its source: |
Richard Felkl | 2e07d65 | 2018-01-19 10:19:06 +0100 | [diff] [blame] | 349 | |
| 350 | .. code-block:: yaml |
| 351 | |
| 352 | linux: |
| 353 | system: |
| 354 | file: |
| 355 | /tmp/test.txt: |
| 356 | source: http://example.com/test.txt |
Richard Felkl | f40599a | 2018-02-06 22:56:41 +0100 | [diff] [blame] | 357 | user: root #optional |
| 358 | group: root #optional |
| 359 | mode: 700 #optional |
| 360 | dir_mode: 700 #optional |
| 361 | encoding: utf-8 #optional |
| 362 | hash: <<hash>> or <<URI to hash>> #optional |
| 363 | makedirs: true #optional |
| 364 | |
| 365 | linux: |
| 366 | system: |
| 367 | file: |
| 368 | test.txt: |
| 369 | name: /tmp/test.txt |
| 370 | source: http://example.com/test.txt |
Richard Felkl | 2e07d65 | 2018-01-19 10:19:06 +0100 | [diff] [blame] | 371 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 372 | Ensure presence of file by specifying its contents: |
Richard Felkl | 2e07d65 | 2018-01-19 10:19:06 +0100 | [diff] [blame] | 373 | |
| 374 | .. code-block:: yaml |
| 375 | |
| 376 | linux: |
| 377 | system: |
| 378 | file: |
| 379 | /tmp/test.txt: |
| 380 | contents: | |
| 381 | line1 |
| 382 | line2 |
Richard Felkl | f40599a | 2018-02-06 22:56:41 +0100 | [diff] [blame] | 383 | |
| 384 | linux: |
| 385 | system: |
| 386 | file: |
| 387 | /tmp/test.txt: |
| 388 | contents_pillar: linux:network:hostname |
| 389 | |
| 390 | linux: |
| 391 | system: |
| 392 | file: |
| 393 | /tmp/test.txt: |
| 394 | contents_grains: motd |
| 395 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 396 | Ensure presence of file to be serialized through one of the |
| 397 | serializer modules (see: |
| 398 | https://docs.saltstack.com/en/latest/ref/serializers/all/index.html): |
Bruno Binet | 9c2fe22 | 2018-06-08 16:57:32 +0200 | [diff] [blame] | 399 | |
| 400 | .. code-block:: yaml |
| 401 | |
| 402 | linux: |
| 403 | system: |
| 404 | file: |
| 405 | /tmp/test.json: |
| 406 | serialize: json |
| 407 | contents: |
| 408 | foo: 1 |
| 409 | bar: 'bar' |
| 410 | |
Filip Pytloun | 281034a | 2016-01-04 18:06:22 +0100 | [diff] [blame] | 411 | Kernel |
| 412 | ~~~~~~ |
| 413 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 414 | Install always up to date LTS kernel and headers from Ubuntu Trusty: |
Filip Pytloun | 281034a | 2016-01-04 18:06:22 +0100 | [diff] [blame] | 415 | |
| 416 | .. code-block:: yaml |
| 417 | |
| 418 | linux: |
| 419 | system: |
| 420 | kernel: |
| 421 | type: generic |
| 422 | lts: trusty |
| 423 | headers: true |
| 424 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 425 | Load kernel modules and add them to ``/etc/modules``: |
Tomáš Kukrál | ba35b21 | 2017-02-15 17:59:46 +0100 | [diff] [blame] | 426 | |
| 427 | .. code-block:: yaml |
| 428 | |
| 429 | linux: |
| 430 | system: |
| 431 | kernel: |
| 432 | modules: |
| 433 | - nf_conntrack |
| 434 | - tp_smapi |
| 435 | - 8021q |
| 436 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 437 | Configure or blacklist kernel modules with additional options to |
| 438 | ``/etc/modprobe.d`` following example will add |
| 439 | ``/etc/modprobe.d/nf_conntrack.conf`` file with line |
| 440 | ``options nf_conntrack hashsize=262144``: |
teoyaomiqui | 32b1f7c | 2017-05-24 14:36:09 +0300 | [diff] [blame] | 441 | |
| 442 | .. code-block:: yaml |
| 443 | |
| 444 | linux: |
| 445 | system: |
| 446 | kernel: |
| 447 | module: |
| 448 | nf_conntrack: |
| 449 | option: |
| 450 | hashsize: 262144 |
| 451 | |
Filip Pytloun | 281034a | 2016-01-04 18:06:22 +0100 | [diff] [blame] | 452 | Install specific kernel version and ensure all other kernel packages are |
| 453 | not present. Also install extra modules and headers for this kernel: |
| 454 | |
| 455 | .. code-block:: yaml |
| 456 | |
| 457 | linux: |
| 458 | system: |
| 459 | kernel: |
| 460 | type: generic |
| 461 | extra: true |
| 462 | headers: true |
| 463 | version: 4.2.0-22 |
| 464 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 465 | Systcl kernel parameters: |
Jakub Pavlik | 32c2cb0 | 2016-01-29 12:45:29 +0100 | [diff] [blame] | 466 | |
| 467 | .. code-block:: yaml |
| 468 | |
| 469 | linux: |
| 470 | system: |
| 471 | kernel: |
| 472 | sysctl: |
| 473 | net.ipv4.tcp_keepalive_intvl: 3 |
| 474 | net.ipv4.tcp_keepalive_time: 30 |
| 475 | net.ipv4.tcp_keepalive_probes: 8 |
| 476 | |
Michael Polenchuk | ebf5552 | 2018-01-25 13:22:39 +0400 | [diff] [blame] | 477 | Configure kernel boot options: |
| 478 | |
| 479 | .. code-block:: yaml |
| 480 | |
| 481 | linux: |
| 482 | system: |
| 483 | kernel: |
| 484 | boot_options: |
| 485 | - elevator=deadline |
| 486 | - spectre_v2=off |
| 487 | - nopti |
| 488 | |
Jiri Broulik | f8f55a2 | 2017-01-26 14:36:46 +0100 | [diff] [blame] | 489 | CPU |
| 490 | ~~~ |
| 491 | |
teoyaomiqui | 32b1f7c | 2017-05-24 14:36:09 +0300 | [diff] [blame] | 492 | Enable cpufreq governor for every cpu: |
Jiri Broulik | f8f55a2 | 2017-01-26 14:36:46 +0100 | [diff] [blame] | 493 | |
| 494 | .. code-block:: yaml |
| 495 | |
| 496 | linux: |
| 497 | system: |
| 498 | cpu: |
| 499 | governor: performance |
| 500 | |
Nick Metz | f04f5f3 | 2018-01-08 15:25:04 +0100 | [diff] [blame] | 501 | |
Jiri Broulik | 303905d | 2018-01-11 14:12:48 +0100 | [diff] [blame] | 502 | CGROUPS |
| 503 | ~~~~~~~ |
| 504 | |
| 505 | Setup linux cgroups: |
| 506 | |
| 507 | .. code-block:: yaml |
| 508 | |
| 509 | linux: |
| 510 | system: |
| 511 | cgroup: |
| 512 | enabled: true |
| 513 | group: |
| 514 | ceph_group_1: |
| 515 | controller: |
| 516 | cpu: |
| 517 | shares: |
| 518 | value: 250 |
| 519 | cpuacct: |
| 520 | usage: |
| 521 | value: 0 |
| 522 | cpuset: |
| 523 | cpus: |
| 524 | value: 1,2,3 |
| 525 | memory: |
| 526 | limit_in_bytes: |
| 527 | value: 2G |
| 528 | memsw.limit_in_bytes: |
| 529 | value: 3G |
| 530 | mapping: |
| 531 | subjects: |
| 532 | - '@ceph' |
| 533 | generic_group_1: |
| 534 | controller: |
| 535 | cpu: |
| 536 | shares: |
| 537 | value: 250 |
| 538 | cpuacct: |
| 539 | usage: |
| 540 | value: 0 |
| 541 | mapping: |
| 542 | subjects: |
| 543 | - '*:firefox' |
| 544 | - 'student:cp' |
| 545 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 546 | Shared libraries |
Nick Metz | f04f5f3 | 2018-01-08 15:25:04 +0100 | [diff] [blame] | 547 | ~~~~~~~~~~~~~~~~ |
| 548 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 549 | Set additional shared library to Linux system library path: |
Nick Metz | f04f5f3 | 2018-01-08 15:25:04 +0100 | [diff] [blame] | 550 | |
| 551 | .. code-block:: yaml |
| 552 | |
| 553 | linux: |
| 554 | system: |
| 555 | ld: |
| 556 | library: |
| 557 | java: |
| 558 | - /usr/lib/jvm/jre-openjdk/lib/amd64/server |
| 559 | - /opt/java/jre/lib/amd64/server |
Ondrej Smola | ef9bd76 | 2018-07-11 14:26:02 +0200 | [diff] [blame] | 560 | |
Filip Pytloun | 2fde88b | 2017-10-05 10:30:29 +0200 | [diff] [blame] | 561 | Certificates |
| 562 | ~~~~~~~~~~~~ |
| 563 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 564 | Add certificate authority into system trusted CA bundle: |
Filip Pytloun | 2fde88b | 2017-10-05 10:30:29 +0200 | [diff] [blame] | 565 | |
| 566 | .. code-block:: yaml |
| 567 | |
| 568 | linux: |
| 569 | system: |
| 570 | ca_certificates: |
| 571 | mycert: | |
| 572 | -----BEGIN CERTIFICATE----- |
| 573 | MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG |
| 574 | A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz |
| 575 | cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 |
| 576 | MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV |
| 577 | BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt |
| 578 | YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN |
| 579 | ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE |
| 580 | BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is |
| 581 | I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G |
| 582 | CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do |
| 583 | lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc |
| 584 | AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k |
| 585 | -----END CERTIFICATE----- |
| 586 | |
Filip Pytloun | 361096c | 2017-08-23 10:57:20 +0200 | [diff] [blame] | 587 | Sysfs |
| 588 | ~~~~~ |
| 589 | |
| 590 | Install sysfsutils and set sysfs attributes: |
| 591 | |
| 592 | .. code-block:: yaml |
| 593 | |
| 594 | linux: |
| 595 | system: |
| 596 | sysfs: |
| 597 | scheduler: |
| 598 | block/sda/queue/scheduler: deadline |
| 599 | power: |
| 600 | mode: |
| 601 | power/state: 0660 |
| 602 | owner: |
| 603 | power/state: "root:power" |
| 604 | devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave |
| 605 | |
Ondrej Smola | ef9bd76 | 2018-07-11 14:26:02 +0200 | [diff] [blame] | 606 | Optional: You can also use list that will ensure order of items. |
| 607 | |
| 608 | .. code-block:: yaml |
| 609 | |
| 610 | linux: |
| 611 | system: |
| 612 | sysfs: |
| 613 | scheduler: |
| 614 | block/sda/queue/scheduler: deadline |
| 615 | power: |
| 616 | - mode: |
| 617 | power/state: 0660 |
| 618 | - owner: |
| 619 | power/state: "root:power" |
| 620 | - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave |
| 621 | |
Jakub Pavlik | b148c8c | 2017-02-12 21:30:48 +0100 | [diff] [blame] | 622 | Huge Pages |
| 623 | ~~~~~~~~~~~~ |
| 624 | |
| 625 | Huge Pages give a performance boost to applications that intensively deal |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 626 | with memory allocation/deallocation by decreasing memory fragmentation: |
Jakub Pavlik | b148c8c | 2017-02-12 21:30:48 +0100 | [diff] [blame] | 627 | |
| 628 | .. code-block:: yaml |
| 629 | |
| 630 | linux: |
| 631 | system: |
| 632 | kernel: |
| 633 | hugepages: |
| 634 | small: |
| 635 | size: 2M |
| 636 | count: 107520 |
| 637 | mount_point: /mnt/hugepages_2MB |
Michael Polenchuk | d9369fe | 2018-05-08 17:53:08 +0400 | [diff] [blame] | 638 | mount: false/true # default is true (mount immediately) / false (just save in the fstab) |
Jakub Pavlik | b148c8c | 2017-02-12 21:30:48 +0100 | [diff] [blame] | 639 | large: |
| 640 | default: true # default automatically mounted |
| 641 | size: 1G |
| 642 | count: 210 |
| 643 | mount_point: /mnt/hugepages_1GB |
| 644 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 645 | .. note:: Not recommended to use both pagesizes concurrently. |
Jiri Broulik | f8f55a2 | 2017-01-26 14:36:46 +0100 | [diff] [blame] | 646 | |
Jakub Pavlik | 5398d87 | 2017-02-13 22:30:47 +0100 | [diff] [blame] | 647 | Intel SR-IOV |
| 648 | ~~~~~~~~~~~~ |
| 649 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 650 | PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV) |
| 651 | specification defines a standardized mechanism to virtualize |
| 652 | PCIe devices. The mechanism can virtualize a single PCIe |
| 653 | Ethernet controller to appear as multiple PCIe devices: |
Jakub Pavlik | 5398d87 | 2017-02-13 22:30:47 +0100 | [diff] [blame] | 654 | |
| 655 | .. code-block:: yaml |
| 656 | |
| 657 | linux: |
| 658 | system: |
| 659 | kernel: |
| 660 | sriov: True |
| 661 | unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround |
| 662 | rc: |
| 663 | local: | |
| 664 | #!/bin/sh -e |
| 665 | # Enable 7 VF on eth1 |
| 666 | echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a |
| 667 | exit 0 |
| 668 | |
Jakub Pavlik | 6c9ead1 | 2017-02-16 21:53:13 +0100 | [diff] [blame] | 669 | Isolate CPU options |
| 670 | ~~~~~~~~~~~~~~~~~~~ |
| 671 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 672 | Remove the specified CPUs, as defined by the cpu_number values, from |
| 673 | the general kernel SMP balancing and scheduler algroithms. The only |
| 674 | way to move a process onto or off an *isolated* CPU is via the CPU |
| 675 | affinity syscalls. ``cpu_number begins`` at ``0``, so the |
| 676 | maximum value is ``1`` less than the number of CPUs on the system.: |
Jakub Pavlik | 6c9ead1 | 2017-02-16 21:53:13 +0100 | [diff] [blame] | 677 | |
| 678 | .. code-block:: yaml |
| 679 | |
| 680 | linux: |
| 681 | system: |
| 682 | kernel: |
| 683 | isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0 |
Jiri Broulik | f8f55a2 | 2017-01-26 14:36:46 +0100 | [diff] [blame] | 684 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 685 | Repositories |
| 686 | ~~~~~~~~~~~~ |
| 687 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 688 | RedHat-based Linux with additional OpenStack repo: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 689 | |
| 690 | .. code-block:: yaml |
| 691 | |
| 692 | linux: |
| 693 | system: |
| 694 | ... |
| 695 | repo: |
| 696 | rdo-icehouse: |
| 697 | enabled: true |
| 698 | source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/' |
| 699 | pgpcheck: 0 |
| 700 | |
| 701 | Ensure system repository to use czech Debian mirror (``default: true``) |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 702 | Also pin it's packages with priority ``900``: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 703 | |
| 704 | .. code-block:: yaml |
| 705 | |
| 706 | linux: |
| 707 | system: |
| 708 | repo: |
| 709 | debian: |
| 710 | default: true |
| 711 | source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free" |
| 712 | # Import signing key from URL if needed |
| 713 | key_url: "http://dummy.com/public.gpg" |
| 714 | pin: |
| 715 | - pin: 'origin "ftp.cz.debian.org"' |
| 716 | priority: 900 |
| 717 | package: '*' |
| 718 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 719 | .. note:: For old Ubuntu releases (<xenial) |
azvyagintsev | ff089d2 | 2018-07-27 16:52:34 +0200 | [diff] [blame] | 720 | extra packages for apt transport, like ``apt-transport-https`` |
| 721 | may be required to be installed manually. |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 722 | (Chicken-eggs issue: we need to install packages to |
azvyagintsev | ff089d2 | 2018-07-27 16:52:34 +0200 | [diff] [blame] | 723 | reach repo from where they should be installed) |
| 724 | Otherwise, you still can try 'fortune' and install prereq.packages before |
| 725 | any repo configuration, using list of requires in map.jinja. |
| 726 | |
| 727 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 728 | Disabling any prerequisite packages installation: |
| 729 | |
azvyagintsev | ff089d2 | 2018-07-27 16:52:34 +0200 | [diff] [blame] | 730 | You can simply drop any package pre-installation (before system.linux.repo |
| 731 | will be processed) via cluster lvl: |
| 732 | |
| 733 | .. code-block:: yaml |
| 734 | |
| 735 | linux: |
| 736 | system: |
| 737 | pkgs: ~ |
| 738 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 739 | Package manager proxy global setup: |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 740 | |
| 741 | .. code-block:: yaml |
| 742 | |
| 743 | linux: |
| 744 | system: |
| 745 | ... |
| 746 | repo: |
| 747 | apt-mk: |
| 748 | source: "deb http://apt-mk.mirantis.com/ stable main salt" |
| 749 | ... |
| 750 | proxy: |
| 751 | pkg: |
| 752 | enabled: true |
| 753 | ftp: ftp://ftp-proxy-for-apt.host.local:2121 |
| 754 | ... |
| 755 | # NOTE: Global defaults for any other componet that configure proxy on the system. |
| 756 | # If your environment has just one simple proxy, set it on linux:system:proxy. |
| 757 | # |
| 758 | # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries |
| 759 | # as for https and http |
| 760 | ftp: ftp://proxy.host.local:2121 |
| 761 | http: http://proxy.host.local:3142 |
| 762 | https: https://proxy.host.local:3143 |
| 763 | |
| 764 | Package manager proxy setup per repository: |
| 765 | |
| 766 | .. code-block:: yaml |
| 767 | |
| 768 | linux: |
| 769 | system: |
| 770 | ... |
| 771 | repo: |
| 772 | debian: |
| 773 | source: "deb http://apt-mk.mirantis.com/ stable main salt" |
| 774 | ... |
| 775 | apt-mk: |
| 776 | source: "deb http://apt-mk.mirantis.com/ stable main salt" |
| 777 | # per repository proxy |
| 778 | proxy: |
| 779 | enabled: true |
| 780 | http: http://maas-01:8080 |
| 781 | https: http://maas-01:8080 |
| 782 | ... |
| 783 | proxy: |
Oleksandr Vlasov | 27a6c3a | 2017-04-11 16:01:19 -0600 | [diff] [blame] | 784 | # package manager fallback defaults |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 785 | # used if linux:system:repo:apt-mk:proxy has no protocol specific entries |
| 786 | pkg: |
| 787 | enabled: true |
| 788 | ftp: ftp://proxy.host.local:2121 |
| 789 | #http: http://proxy.host.local:3142 |
| 790 | #https: https://proxy.host.local:3143 |
Oleksandr Vlasov | 27a6c3a | 2017-04-11 16:01:19 -0600 | [diff] [blame] | 791 | ... |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 792 | # global system fallback system defaults |
| 793 | ftp: ftp://proxy.host.local:2121 |
| 794 | http: http://proxy.host.local:3142 |
| 795 | https: https://proxy.host.local:3143 |
| 796 | |
Jiri Broulik | 34a29b4 | 2017-04-25 14:42:54 +0200 | [diff] [blame] | 797 | Remove all repositories: |
| 798 | |
| 799 | .. code-block:: yaml |
| 800 | |
| 801 | linux: |
| 802 | system: |
| 803 | purge_repos: true |
| 804 | |
azvyagintsev | ff089d2 | 2018-07-27 16:52:34 +0200 | [diff] [blame] | 805 | Refresh repositories metada, after configuration: |
| 806 | |
| 807 | .. code-block:: yaml |
| 808 | |
| 809 | linux: |
| 810 | system: |
| 811 | refresh_repos_meta: true |
| 812 | |
Filip Pytloun | c512e6c | 2017-11-22 14:28:10 +0100 | [diff] [blame] | 813 | Setup custom apt config options: |
| 814 | |
| 815 | .. code-block:: yaml |
| 816 | |
| 817 | linux: |
| 818 | system: |
| 819 | apt: |
| 820 | config: |
| 821 | compression-workaround: |
| 822 | "Acquire::CompressionTypes::Order": "gz" |
| 823 | docker-clean: |
| 824 | "DPkg::Post-Invoke": |
| 825 | - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true" |
| 826 | "APT::Update::Post-Invoke": |
| 827 | - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true" |
Jiri Broulik | 34a29b4 | 2017-04-25 14:42:54 +0200 | [diff] [blame] | 828 | |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 829 | RC |
| 830 | ~~ |
| 831 | |
Jakub Pavlik | 7885938 | 2016-01-21 11:26:39 +0100 | [diff] [blame] | 832 | rc.local example |
| 833 | |
| 834 | .. code-block:: yaml |
| 835 | |
| 836 | linux: |
| 837 | system: |
| 838 | rc: |
| 839 | local: | |
| 840 | #!/bin/sh -e |
| 841 | # |
| 842 | # rc.local |
| 843 | # |
| 844 | # This script is executed at the end of each multiuser runlevel. |
| 845 | # Make sure that the script will "exit 0" on success or any other |
| 846 | # value on error. |
| 847 | # |
| 848 | # In order to enable or disable this script just change the execution |
| 849 | # bits. |
| 850 | # |
| 851 | # By default this script does nothing. |
| 852 | exit 0 |
| 853 | |
Filip Pytloun | 1f40dac | 2016-01-22 15:52:57 +0100 | [diff] [blame] | 854 | Prompt |
| 855 | ~~~~~~ |
| 856 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 857 | Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. |
| 858 | Every user can have different prompt: |
Filip Pytloun | 1f40dac | 2016-01-22 15:52:57 +0100 | [diff] [blame] | 859 | |
| 860 | .. code-block:: yaml |
| 861 | |
| 862 | linux: |
| 863 | system: |
| 864 | prompt: |
| 865 | root: \\n\\[\\033[0;37m\\]\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\[\\e[0m\\]\\n\\[\\e[1;31m\\][\\u@\\h:\\w]\\[\\e[0m\\] |
| 866 | default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w] |
| 867 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 868 | On Debian systems, to set prompt system-wide, it's necessary to |
| 869 | remove setting PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc``, |
| 870 | which comes from ``/etc/skel/.bashrc``. This formula will do |
| 871 | this automatically, but will not touch existing user's |
| 872 | ``~/.bashrc`` files except root. |
Jakub Pavlik | 7885938 | 2016-01-21 11:26:39 +0100 | [diff] [blame] | 873 | |
Filip Pytloun | eef11c1 | 2016-03-25 11:00:23 +0100 | [diff] [blame] | 874 | Bash |
| 875 | ~~~~ |
| 876 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 877 | Fix bash configuration to preserve history across sessions |
| 878 | like ZSH does by default: |
Filip Pytloun | eef11c1 | 2016-03-25 11:00:23 +0100 | [diff] [blame] | 879 | |
| 880 | .. code-block:: yaml |
| 881 | |
| 882 | linux: |
| 883 | system: |
| 884 | bash: |
| 885 | preserve_history: true |
| 886 | |
Dmitry Teselkin | 949398e | 2018-05-03 15:50:00 +0300 | [diff] [blame] | 887 | Login banner message |
| 888 | ~~~~~~~~~~~~~~~~~~~~ |
| 889 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 890 | ``/etc/issue`` is a text file which contains a message or system |
| 891 | identification to be printed before the login prompt. It may contain |
Dmitry Teselkin | 949398e | 2018-05-03 15:50:00 +0300 | [diff] [blame] | 892 | various @char and \char sequences, if supported by the getty-type |
| 893 | program employed on the system. |
| 894 | |
| 895 | Setting logon banner message is easy: |
| 896 | |
| 897 | .. code-block:: yaml |
| 898 | |
| 899 | liunx: |
| 900 | system: |
| 901 | banner: |
| 902 | enabled: true |
| 903 | contents: | |
| 904 | UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED |
| 905 | |
| 906 | You must have explicit, authorized permission to access or configure this |
| 907 | device. Unauthorized attempts and actions to access or use this system may |
| 908 | result in civil and/or criminal penalties. |
| 909 | All activities performed on this system are logged and monitored. |
| 910 | |
Filip Pytloun | e874dfb | 2016-01-22 16:57:34 +0100 | [diff] [blame] | 911 | Message of the day |
| 912 | ~~~~~~~~~~~~~~~~~~ |
| 913 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 914 | ``pam_motd`` from package ``libpam-modules`` is used for dynamic |
| 915 | messages of the day. Setting custom ``motd`` will clean up existing ones. |
Filip Pytloun | e874dfb | 2016-01-22 16:57:34 +0100 | [diff] [blame] | 916 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 917 | Setting static ``motd`` will replace existing ``/etc/motd`` and remove |
| 918 | scripts from ``/etc/update-motd.d``. |
Dmitry Teselkin | 538c824 | 2018-04-02 16:13:37 +0300 | [diff] [blame] | 919 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 920 | Setting static ``motd``: |
Dmitry Teselkin | 538c824 | 2018-04-02 16:13:37 +0300 | [diff] [blame] | 921 | |
| 922 | .. code-block:: yaml |
| 923 | |
| 924 | linux: |
| 925 | system: |
| 926 | motd: | |
| 927 | UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED |
| 928 | |
| 929 | You must have explicit, authorized permission to access or configure this |
| 930 | device. Unauthorized attempts and actions to access or use this system may |
| 931 | result in civil and/or criminal penalties. |
| 932 | All activities performed on this system are logged and monitored. |
| 933 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 934 | Setting dynamic ``motd``: |
Dmitry Teselkin | 538c824 | 2018-04-02 16:13:37 +0300 | [diff] [blame] | 935 | |
Filip Pytloun | e874dfb | 2016-01-22 16:57:34 +0100 | [diff] [blame] | 936 | .. code-block:: yaml |
| 937 | |
| 938 | linux: |
| 939 | system: |
| 940 | motd: |
| 941 | - release: | |
| 942 | #!/bin/sh |
| 943 | [ -r /etc/lsb-release ] && . /etc/lsb-release |
| 944 | |
| 945 | if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then |
| 946 | # Fall back to using the very slow lsb_release utility |
| 947 | DISTRIB_DESCRIPTION=$(lsb_release -s -d) |
| 948 | fi |
| 949 | |
| 950 | printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)" |
| 951 | - warning: | |
| 952 | #!/bin/sh |
| 953 | printf "This is [company name] network.\n" |
| 954 | printf "Unauthorized access strictly prohibited.\n" |
| 955 | |
Marek Celoud | 713e907 | 2017-05-18 15:20:25 +0200 | [diff] [blame] | 956 | Services |
| 957 | ~~~~~~~~ |
| 958 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 959 | Stop and disable the ``linux`` service: |
Marek Celoud | 713e907 | 2017-05-18 15:20:25 +0200 | [diff] [blame] | 960 | |
| 961 | .. code-block:: yaml |
| 962 | |
| 963 | linux: |
| 964 | system: |
| 965 | service: |
| 966 | apt-daily.timer: |
| 967 | status: dead |
| 968 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 969 | Possible statuses are ``dead`` (disable service by default), ``running`` |
| 970 | (enable service by default), ``enabled``, ``disabled``: |
Marek Celoud | 713e907 | 2017-05-18 15:20:25 +0200 | [diff] [blame] | 971 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 972 | Linux with the ``atop`` service: |
Serhiy Ovsianikov | 67bd56a | 2017-08-11 15:56:01 +0300 | [diff] [blame] | 973 | |
| 974 | .. code-block:: yaml |
| 975 | |
| 976 | linux: |
| 977 | system: |
| 978 | atop: |
| 979 | enabled: true |
| 980 | interval: 20 |
| 981 | logpath: "/var/log/atop" |
| 982 | outfile: "/var/log/atop/daily.log" |
| 983 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 984 | Linux with the ``mcelog`` service: |
Oleksii Chupryn | 144432b | 2018-05-22 10:34:48 +0300 | [diff] [blame] | 985 | |
| 986 | .. code-block:: yaml |
| 987 | |
| 988 | linux: |
| 989 | system: |
| 990 | mcelog: |
| 991 | enabled: true |
| 992 | logging: |
| 993 | syslog: true |
| 994 | syslog_error: true |
| 995 | |
Filip Pytloun | 2f70b49 | 2016-02-19 15:55:25 +0100 | [diff] [blame] | 996 | RHEL / CentOS |
Filip Pytloun | 8296bb9 | 2016-02-19 18:42:09 +0100 | [diff] [blame] | 997 | ^^^^^^^^^^^^^ |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 998 | Currently, ``update-motd`` is not available |
| 999 | for RHEL. So there is no native support for dynamic ``motd``. |
| 1000 | You can still set a static one, with a different pillar structure: |
Filip Pytloun | 2f70b49 | 2016-02-19 15:55:25 +0100 | [diff] [blame] | 1001 | |
| 1002 | .. code-block:: yaml |
| 1003 | |
| 1004 | linux: |
| 1005 | system: |
| 1006 | motd: | |
| 1007 | This is [company name] network. |
| 1008 | Unauthorized access strictly prohibited. |
| 1009 | |
Filip Pytloun | 8296bb9 | 2016-02-19 18:42:09 +0100 | [diff] [blame] | 1010 | Haveged |
| 1011 | ~~~~~~~ |
| 1012 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1013 | If you are running headless server and are low on entropy, |
| 1014 | you may set up Haveged: |
Filip Pytloun | 8296bb9 | 2016-02-19 18:42:09 +0100 | [diff] [blame] | 1015 | |
| 1016 | .. code-block:: yaml |
| 1017 | |
| 1018 | linux: |
| 1019 | system: |
| 1020 | haveged: |
| 1021 | enabled: true |
| 1022 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1023 | Linux network |
| 1024 | ------------- |
| 1025 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1026 | Linux with network manager: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1027 | |
| 1028 | .. code-block:: yaml |
| 1029 | |
| 1030 | linux: |
| 1031 | network: |
| 1032 | enabled: true |
| 1033 | network_manager: true |
| 1034 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1035 | Linux with default static network interfaces, default gateway |
| 1036 | interface and DNS servers: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1037 | |
| 1038 | .. code-block:: yaml |
| 1039 | |
| 1040 | linux: |
| 1041 | network: |
| 1042 | enabled: true |
| 1043 | interface: |
| 1044 | eth0: |
| 1045 | enabled: true |
| 1046 | type: eth |
| 1047 | address: 192.168.0.102 |
| 1048 | netmask: 255.255.255.0 |
| 1049 | gateway: 192.168.0.1 |
| 1050 | name_servers: |
| 1051 | - 8.8.8.8 |
| 1052 | - 8.8.4.4 |
| 1053 | mtu: 1500 |
| 1054 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1055 | Linux with bonded interfaces and disabled ``NetworkManager``: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1056 | |
| 1057 | .. code-block:: yaml |
| 1058 | |
| 1059 | linux: |
| 1060 | network: |
| 1061 | enabled: true |
| 1062 | interface: |
| 1063 | eth0: |
| 1064 | type: eth |
| 1065 | ... |
| 1066 | eth1: |
| 1067 | type: eth |
| 1068 | ... |
| 1069 | bond0: |
| 1070 | enabled: true |
| 1071 | type: bond |
| 1072 | address: 192.168.0.102 |
| 1073 | netmask: 255.255.255.0 |
| 1074 | mtu: 1500 |
| 1075 | use_in: |
| 1076 | - interface: ${linux:interface:eth0} |
| 1077 | - interface: ${linux:interface:eth0} |
jan kaufman | 6d30adf | 2016-01-18 17:30:12 +0100 | [diff] [blame] | 1078 | network_manager: |
| 1079 | disable: true |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1080 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1081 | Linux with VLAN ``interface_params``: |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 1082 | |
| 1083 | .. code-block:: yaml |
| 1084 | |
| 1085 | linux: |
| 1086 | network: |
| 1087 | enabled: true |
| 1088 | interface: |
| 1089 | vlan69: |
| 1090 | type: vlan |
jan kaufman | c0bd76f | 2015-12-15 16:45:44 +0100 | [diff] [blame] | 1091 | use_interfaces: |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 1092 | - interface: ${linux:interface:bond0} |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 1093 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1094 | Linux with wireless interface parameters: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1095 | |
| 1096 | .. code-block:: yaml |
| 1097 | |
| 1098 | linux: |
| 1099 | network: |
| 1100 | enabled: true |
| 1101 | gateway: 10.0.0.1 |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 1102 | default_interface: eth0 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1103 | interface: |
| 1104 | wlan0: |
| 1105 | type: eth |
| 1106 | wireless: |
| 1107 | essid: example |
| 1108 | key: example_key |
| 1109 | security: wpa |
| 1110 | priority: 1 |
| 1111 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1112 | Linux networks with routes defined: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1113 | |
| 1114 | .. code-block:: yaml |
| 1115 | |
| 1116 | linux: |
| 1117 | network: |
| 1118 | enabled: true |
| 1119 | gateway: 10.0.0.1 |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 1120 | default_interface: eth0 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1121 | interface: |
| 1122 | eth0: |
| 1123 | type: eth |
| 1124 | route: |
| 1125 | default: |
| 1126 | address: 192.168.0.123 |
| 1127 | netmask: 255.255.255.0 |
| 1128 | gateway: 192.168.0.1 |
| 1129 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1130 | Native Linux Bridges: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1131 | |
| 1132 | .. code-block:: yaml |
| 1133 | |
| 1134 | linux: |
| 1135 | network: |
| 1136 | interface: |
| 1137 | eth1: |
| 1138 | enabled: true |
| 1139 | type: eth |
| 1140 | proto: manual |
| 1141 | up_cmds: |
| 1142 | - ip address add 0/0 dev $IFACE |
| 1143 | - ip link set $IFACE up |
| 1144 | down_cmds: |
| 1145 | - ip link set $IFACE down |
| 1146 | br-ex: |
| 1147 | enabled: true |
| 1148 | type: bridge |
| 1149 | address: ${linux:network:host:public_local:address} |
| 1150 | netmask: 255.255.255.0 |
| 1151 | use_interfaces: |
| 1152 | - eth1 |
| 1153 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1154 | Open vSwitch Bridges: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1155 | |
| 1156 | .. code-block:: yaml |
| 1157 | |
| 1158 | linux: |
| 1159 | network: |
| 1160 | bridge: openvswitch |
| 1161 | interface: |
| 1162 | eth1: |
| 1163 | enabled: true |
| 1164 | type: eth |
| 1165 | proto: manual |
| 1166 | up_cmds: |
| 1167 | - ip address add 0/0 dev $IFACE |
| 1168 | - ip link set $IFACE up |
| 1169 | down_cmds: |
| 1170 | - ip link set $IFACE down |
| 1171 | br-ex: |
| 1172 | enabled: true |
| 1173 | type: bridge |
| 1174 | address: ${linux:network:host:public_local:address} |
| 1175 | netmask: 255.255.255.0 |
| 1176 | use_interfaces: |
| 1177 | - eth1 |
Dmitry Stremkouski | a581ea7 | 2017-10-18 14:24:16 +0300 | [diff] [blame] | 1178 | br-prv: |
| 1179 | enabled: true |
| 1180 | type: ovs_bridge |
| 1181 | mtu: 65000 |
| 1182 | br-ens7: |
| 1183 | enabled: true |
| 1184 | name: br-ens7 |
| 1185 | type: ovs_bridge |
| 1186 | proto: manual |
| 1187 | mtu: 9000 |
| 1188 | use_interfaces: |
| 1189 | - ens7 |
| 1190 | patch-br-ens7-br-prv: |
| 1191 | enabled: true |
| 1192 | name: ens7-prv |
| 1193 | ovs_type: ovs_port |
| 1194 | type: ovs_port |
| 1195 | bridge: br-ens7 |
| 1196 | port_type: patch |
| 1197 | peer: prv-ens7 |
Oleksii Chupryn | 694ee72 | 2018-06-13 14:08:58 +0300 | [diff] [blame] | 1198 | tag: 109 # [] to unset a tag |
Dmitry Stremkouski | a581ea7 | 2017-10-18 14:24:16 +0300 | [diff] [blame] | 1199 | mtu: 65000 |
| 1200 | patch-br-prv-br-ens7: |
| 1201 | enabled: true |
| 1202 | name: prv-ens7 |
| 1203 | bridge: br-prv |
| 1204 | ovs_type: ovs_port |
| 1205 | type: ovs_port |
| 1206 | port_type: patch |
| 1207 | peer: ens7-prv |
Oleksii Chupryn | 694ee72 | 2018-06-13 14:08:58 +0300 | [diff] [blame] | 1208 | tag: 109 |
Dmitry Stremkouski | a581ea7 | 2017-10-18 14:24:16 +0300 | [diff] [blame] | 1209 | mtu: 65000 |
| 1210 | ens7: |
| 1211 | enabled: true |
| 1212 | name: ens7 |
| 1213 | proto: manual |
| 1214 | ovs_port_type: OVSPort |
| 1215 | type: ovs_port |
| 1216 | ovs_bridge: br-ens7 |
| 1217 | bridge: br-ens7 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1218 | |
Petr Jediný | 8f8ae54 | 2017-07-13 16:19:12 +0200 | [diff] [blame] | 1219 | Debian manual proto interfaces |
| 1220 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1221 | When you are changing interface proto from static in up state |
| 1222 | to manual, you may need to flush ip addresses. For example, |
| 1223 | if you want to use the interface and the ip on the bridge. |
| 1224 | This can be done by setting the ``ipflush_onchange`` to true. |
Petr Jediný | 8f8ae54 | 2017-07-13 16:19:12 +0200 | [diff] [blame] | 1225 | |
| 1226 | .. code-block:: yaml |
| 1227 | |
| 1228 | linux: |
| 1229 | network: |
| 1230 | interface: |
| 1231 | eth1: |
| 1232 | enabled: true |
| 1233 | type: eth |
| 1234 | proto: manual |
| 1235 | mtu: 9100 |
| 1236 | ipflush_onchange: true |
| 1237 | |
Jiri Broulik | 1a191e3 | 2018-01-15 15:54:21 +0100 | [diff] [blame] | 1238 | Debian static proto interfaces |
| 1239 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1240 | When you are changing interface proto from dhcp in up state to |
| 1241 | static, you may need to flush ip addresses and restart interface |
| 1242 | to assign ip address from a managed file. For example, if you wantto |
| 1243 | use the interface and the ip on the bridge. This can be done by |
| 1244 | setting the ``ipflush_onchange`` with combination ``restart_on_ipflush`` |
| 1245 | param set to true. |
Jiri Broulik | 1a191e3 | 2018-01-15 15:54:21 +0100 | [diff] [blame] | 1246 | |
| 1247 | .. code-block:: yaml |
| 1248 | |
| 1249 | linux: |
| 1250 | network: |
| 1251 | interface: |
| 1252 | eth1: |
| 1253 | enabled: true |
| 1254 | type: eth |
| 1255 | proto: static |
| 1256 | address: 10.1.0.22 |
| 1257 | netmask: 255.255.255.0 |
| 1258 | ipflush_onchange: true |
| 1259 | restart_on_ipflush: true |
Petr Jediný | 8f8ae54 | 2017-07-13 16:19:12 +0200 | [diff] [blame] | 1260 | |
Petr Jediný | d577cb5 | 2017-06-28 20:17:49 +0200 | [diff] [blame] | 1261 | Concatinating and removing interface files |
| 1262 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1263 | Debian based distributions have ``/etc/network/interfaces.d/`` |
| 1264 | directory, where you can store configuration of network |
| 1265 | interfaces in separate files. You can concatinate the files |
| 1266 | to the defined destination when needed, this operation removes |
| 1267 | the file from the ``/etc/network/interfaces.d/``. If you just need |
| 1268 | to remove iface files, you can use the ``remove_iface_files`` key. |
Petr Jediný | d577cb5 | 2017-06-28 20:17:49 +0200 | [diff] [blame] | 1269 | |
| 1270 | .. code-block:: yaml |
| 1271 | |
| 1272 | linux: |
| 1273 | network: |
| 1274 | concat_iface_files: |
| 1275 | - src: '/etc/network/interfaces.d/50-cloud-init.cfg' |
| 1276 | dst: '/etc/network/interfaces' |
| 1277 | remove_iface_files: |
| 1278 | - '/etc/network/interfaces.d/90-custom.cfg' |
| 1279 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1280 | Configure DHCP client |
Petr Jediný | d577cb5 | 2017-06-28 20:17:49 +0200 | [diff] [blame] | 1281 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1282 | None of the keys is mandatory, include only those you really need. |
| 1283 | For full list of available options under send, supersede, prepend, |
| 1284 | append refer to dhcp-options(5). |
Oleksandr Vlasov | 27a6c3a | 2017-04-11 16:01:19 -0600 | [diff] [blame] | 1285 | |
| 1286 | .. code-block:: yaml |
| 1287 | |
| 1288 | linux: |
| 1289 | network: |
| 1290 | dhclient: |
| 1291 | enabled: true |
| 1292 | backoff_cutoff: 15 |
| 1293 | initial_interval: 10 |
| 1294 | reboot: 10 |
| 1295 | retry: 60 |
| 1296 | select_timeout: 0 |
| 1297 | timeout: 120 |
| 1298 | send: |
| 1299 | - option: host-name |
| 1300 | declaration: "= gethostname()" |
| 1301 | supersede: |
| 1302 | - option: host-name |
| 1303 | declaration: "spaceship" |
| 1304 | - option: domain-name |
| 1305 | declaration: "domain.home" |
| 1306 | #- option: arp-cache-timeout |
| 1307 | # declaration: 20 |
| 1308 | prepend: |
| 1309 | - option: domain-name-servers |
| 1310 | declaration: |
| 1311 | - 8.8.8.8 |
| 1312 | - 8.8.4.4 |
| 1313 | - option: domain-search |
| 1314 | declaration: |
| 1315 | - example.com |
| 1316 | - eng.example.com |
| 1317 | #append: |
| 1318 | #- option: domain-name-servers |
| 1319 | # declaration: 127.0.0.1 |
| 1320 | # ip or subnet to reject dhcp offer from |
| 1321 | reject: |
| 1322 | - 192.33.137.209 |
| 1323 | - 10.0.2.0/24 |
| 1324 | request: |
| 1325 | - subnet-mask |
| 1326 | - broadcast-address |
| 1327 | - time-offset |
| 1328 | - routers |
| 1329 | - domain-name |
| 1330 | - domain-name-servers |
| 1331 | - domain-search |
| 1332 | - host-name |
| 1333 | - dhcp6.name-servers |
| 1334 | - dhcp6.domain-search |
| 1335 | - dhcp6.fqdn |
| 1336 | - dhcp6.sntp-servers |
| 1337 | - netbios-name-servers |
| 1338 | - netbios-scope |
| 1339 | - interface-mtu |
| 1340 | - rfc3442-classless-static-routes |
| 1341 | - ntp-servers |
| 1342 | require: |
| 1343 | - subnet-mask |
| 1344 | - domain-name-servers |
| 1345 | # if per interface configuration required add below |
| 1346 | interface: |
| 1347 | ens2: |
| 1348 | initial_interval: 11 |
| 1349 | reject: |
| 1350 | - 192.33.137.210 |
| 1351 | ens3: |
| 1352 | initial_interval: 12 |
| 1353 | reject: |
| 1354 | - 192.33.137.211 |
| 1355 | |
Petr Michalec | eb14b55 | 2017-06-01 10:27:05 +0200 | [diff] [blame] | 1356 | Linux network systemd settings: |
| 1357 | |
| 1358 | .. code-block:: yaml |
| 1359 | |
| 1360 | linux: |
| 1361 | network: |
| 1362 | ... |
| 1363 | systemd: |
| 1364 | link: |
| 1365 | 10-iface-dmz: |
| 1366 | Match: |
| 1367 | MACAddress: c8:5b:67:fa:1a:af |
| 1368 | OriginalName: eth0 |
| 1369 | Link: |
| 1370 | Name: dmz0 |
| 1371 | netdev: |
| 1372 | 20-bridge-dmz: |
| 1373 | match: |
| 1374 | name: dmz0 |
| 1375 | network: |
| 1376 | mescription: bridge |
| 1377 | bridge: br-dmz0 |
| 1378 | network: |
| 1379 | # works with lowercase, keys are by default capitalized |
| 1380 | 40-dhcp: |
| 1381 | match: |
| 1382 | name: '*' |
| 1383 | network: |
| 1384 | DHCP: yes |
| 1385 | |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1386 | Configure global environment variables |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1387 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1388 | Use ``/etc/environment`` for static system wide variable assignment |
| 1389 | after boot. Variable expansion is frequently not supported. |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1390 | |
| 1391 | .. code-block:: yaml |
| 1392 | |
| 1393 | linux: |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1394 | system: |
| 1395 | env: |
| 1396 | BOB_VARIABLE: Alice |
| 1397 | ... |
| 1398 | BOB_PATH: |
| 1399 | - /srv/alice/bin |
| 1400 | - /srv/bob/bin |
| 1401 | ... |
| 1402 | ftp_proxy: none |
| 1403 | http_proxy: http://global-http-proxy.host.local:8080 |
| 1404 | https_proxy: ${linux:system:proxy:https} |
| 1405 | no_proxy: |
| 1406 | - 192.168.0.80 |
| 1407 | - 192.168.1.80 |
| 1408 | - .domain.com |
| 1409 | - .local |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1410 | ... |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1411 | # NOTE: global defaults proxy configuration. |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1412 | proxy: |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1413 | ftp: ftp://proxy.host.local:2121 |
| 1414 | http: http://proxy.host.local:3142 |
| 1415 | https: https://proxy.host.local:3143 |
| 1416 | noproxy: |
| 1417 | - .domain.com |
| 1418 | - .local |
| 1419 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1420 | Configure the ``profile.d`` scripts |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1421 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1422 | The ``profile.d`` scripts are being sourced during ``.sh`` execution |
| 1423 | and support variable expansion in opposite to /etc/environment global |
| 1424 | settings in ``/etc/environment``. |
Petr Michalec | 10462bb | 2017-03-23 19:18:08 +0100 | [diff] [blame] | 1425 | |
| 1426 | .. code-block:: yaml |
| 1427 | |
| 1428 | linux: |
| 1429 | system: |
| 1430 | profile: |
| 1431 | locales: | |
| 1432 | export LANG=C |
| 1433 | export LC_ALL=C |
| 1434 | ... |
| 1435 | vi_flavors.sh: | |
| 1436 | export PAGER=view |
| 1437 | export EDITOR=vim |
| 1438 | alias vi=vim |
| 1439 | shell_locales.sh: | |
| 1440 | export LANG=en_US |
| 1441 | export LC_ALL=en_US.UTF-8 |
| 1442 | shell_proxies.sh: | |
| 1443 | export FTP_PROXY=ftp://127.0.3.3:2121 |
| 1444 | export NO_PROXY='.local' |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1445 | |
| 1446 | Linux with hosts |
| 1447 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1448 | Parameter ``purge_hosts`` will enforce whole ``/etc/hosts file``, |
| 1449 | removing entries that are not defined in model except defaults |
| 1450 | for both IPv4 and IPv6 localhost and hostname as well as FQDN. |
Ales Komarek | 417e8c5 | 2017-08-25 15:10:29 +0200 | [diff] [blame] | 1451 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1452 | We recommend using this option to verify that ``/etc/hosts`` |
| 1453 | is always in a clean state. However it is not enabled by default |
| 1454 | for security reasons. |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 1455 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1456 | .. code-block:: yaml |
| 1457 | |
| 1458 | linux: |
| 1459 | network: |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 1460 | purge_hosts: true |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1461 | host: |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 1462 | # No need to define this one if purge_hosts is true |
| 1463 | hostname: |
| 1464 | address: 127.0.1.1 |
| 1465 | names: |
| 1466 | - ${linux:network:fqdn} |
| 1467 | - ${linux:network:hostname} |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1468 | node1: |
| 1469 | address: 192.168.10.200 |
| 1470 | names: |
| 1471 | - node2.domain.com |
| 1472 | - service2.domain.com |
| 1473 | node2: |
| 1474 | address: 192.168.10.201 |
| 1475 | names: |
| 1476 | - node2.domain.com |
| 1477 | - service2.domain.com |
| 1478 | |
Ales Komarek | 417e8c5 | 2017-08-25 15:10:29 +0200 | [diff] [blame] | 1479 | Linux with hosts collected from mine |
| 1480 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1481 | All DNS records defined within infrastrucuture |
| 1482 | are passed to the local hosts records or any DNS server. Only |
| 1483 | hosts with the ``grain`` parameter set to ``true`` will be propagated |
| 1484 | to the mine. |
Ales Komarek | 417e8c5 | 2017-08-25 15:10:29 +0200 | [diff] [blame] | 1485 | |
| 1486 | .. code-block:: yaml |
| 1487 | |
| 1488 | linux: |
| 1489 | network: |
| 1490 | purge_hosts: true |
| 1491 | mine_dns_records: true |
| 1492 | host: |
| 1493 | node1: |
| 1494 | address: 192.168.10.200 |
| 1495 | grain: true |
| 1496 | names: |
| 1497 | - node2.domain.com |
| 1498 | - service2.domain.com |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 1499 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1500 | Set up ``resolv.conf``, nameservers, domain and search domains: |
Filip Pytloun | de9bea5 | 2016-01-11 15:39:10 +0100 | [diff] [blame] | 1501 | |
| 1502 | .. code-block:: yaml |
| 1503 | |
| 1504 | linux: |
| 1505 | network: |
| 1506 | resolv: |
| 1507 | dns: |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1508 | - 8.8.4.4 |
| 1509 | - 8.8.8.8 |
Filip Pytloun | de9bea5 | 2016-01-11 15:39:10 +0100 | [diff] [blame] | 1510 | domain: my.example.com |
| 1511 | search: |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1512 | - my.example.com |
| 1513 | - example.com |
Marek Celoud | f6cd192 | 2016-12-05 13:39:49 +0100 | [diff] [blame] | 1514 | options: |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1515 | - ndots: 5 |
| 1516 | - timeout: 2 |
| 1517 | - attempts: 2 |
Filip Pytloun | de9bea5 | 2016-01-11 15:39:10 +0100 | [diff] [blame] | 1518 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1519 | Set up custom TX queue length for tap interfaces: |
Andrii Petrenko | 735761d | 2017-03-21 17:17:35 -0700 | [diff] [blame] | 1520 | |
| 1521 | .. code-block:: yaml |
| 1522 | |
| 1523 | linux: |
| 1524 | network: |
| 1525 | tap_custom_txqueuelen: 10000 |
| 1526 | |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1527 | DPDK OVS interfaces |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1528 | |
| 1529 | **DPDK OVS NIC** |
| 1530 | |
| 1531 | .. code-block:: yaml |
| 1532 | |
| 1533 | linux: |
| 1534 | network: |
| 1535 | bridge: openvswitch |
| 1536 | dpdk: |
| 1537 | enabled: true |
Oleg Bondarev | 9a46679 | 2017-05-25 15:55:42 +0400 | [diff] [blame] | 1538 | driver: uio/vfio |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1539 | openvswitch: |
| 1540 | pmd_cpu_mask: "0x6" |
| 1541 | dpdk_socket_mem: "1024,1024" |
| 1542 | dpdk_lcore_mask: "0x400" |
| 1543 | memory_channels: 2 |
| 1544 | interface: |
| 1545 | dpkd0: |
| 1546 | name: ${_param:dpdk_nic} |
| 1547 | pci: 0000:06:00.0 |
Oleg Bondarev | 9a46679 | 2017-05-25 15:55:42 +0400 | [diff] [blame] | 1548 | driver: igb_uio/vfio-pci |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1549 | enabled: true |
| 1550 | type: dpdk_ovs_port |
| 1551 | n_rxq: 2 |
Oleg Bondarev | 43dbbd3 | 2017-05-24 17:06:19 +0400 | [diff] [blame] | 1552 | pmd_rxq_affinity: "0:1,1:2" |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1553 | bridge: br-prv |
Jakub Pavlik | aa75906 | 2017-03-13 15:57:26 +0100 | [diff] [blame] | 1554 | mtu: 9000 |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1555 | br-prv: |
| 1556 | enabled: true |
| 1557 | type: dpdk_ovs_bridge |
| 1558 | |
| 1559 | **DPDK OVS Bond** |
| 1560 | |
| 1561 | .. code-block:: yaml |
| 1562 | |
| 1563 | linux: |
| 1564 | network: |
| 1565 | bridge: openvswitch |
| 1566 | dpdk: |
| 1567 | enabled: true |
Oleg Bondarev | 9a46679 | 2017-05-25 15:55:42 +0400 | [diff] [blame] | 1568 | driver: uio/vfio |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1569 | openvswitch: |
| 1570 | pmd_cpu_mask: "0x6" |
| 1571 | dpdk_socket_mem: "1024,1024" |
| 1572 | dpdk_lcore_mask: "0x400" |
| 1573 | memory_channels: 2 |
| 1574 | interface: |
| 1575 | dpdk_second_nic: |
| 1576 | name: ${_param:primary_second_nic} |
| 1577 | pci: 0000:06:00.0 |
Oleg Bondarev | 9a46679 | 2017-05-25 15:55:42 +0400 | [diff] [blame] | 1578 | driver: igb_uio/vfio-pci |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1579 | bond: dpdkbond0 |
| 1580 | enabled: true |
| 1581 | type: dpdk_ovs_port |
| 1582 | n_rxq: 2 |
Oleg Bondarev | 43dbbd3 | 2017-05-24 17:06:19 +0400 | [diff] [blame] | 1583 | pmd_rxq_affinity: "0:1,1:2" |
Jakub Pavlik | aa75906 | 2017-03-13 15:57:26 +0100 | [diff] [blame] | 1584 | mtu: 9000 |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1585 | dpdk_first_nic: |
| 1586 | name: ${_param:primary_first_nic} |
| 1587 | pci: 0000:05:00.0 |
Oleg Bondarev | 9a46679 | 2017-05-25 15:55:42 +0400 | [diff] [blame] | 1588 | driver: igb_uio/vfio-pci |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1589 | bond: dpdkbond0 |
| 1590 | enabled: true |
| 1591 | type: dpdk_ovs_port |
| 1592 | n_rxq: 2 |
Oleg Bondarev | 43dbbd3 | 2017-05-24 17:06:19 +0400 | [diff] [blame] | 1593 | pmd_rxq_affinity: "0:1,1:2" |
Jakub Pavlik | aa75906 | 2017-03-13 15:57:26 +0100 | [diff] [blame] | 1594 | mtu: 9000 |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1595 | dpdkbond0: |
| 1596 | enabled: true |
| 1597 | bridge: br-prv |
| 1598 | type: dpdk_ovs_bond |
| 1599 | mode: active-backup |
| 1600 | br-prv: |
| 1601 | enabled: true |
| 1602 | type: dpdk_ovs_bridge |
| 1603 | |
Dzmitry Stremkouski | f619b07 | 2018-03-15 20:13:42 +0100 | [diff] [blame] | 1604 | **DPDK OVS LACP Bond with vlan tag** |
| 1605 | |
| 1606 | .. code-block:: yaml |
| 1607 | |
| 1608 | linux: |
| 1609 | network: |
| 1610 | bridge: openvswitch |
| 1611 | dpdk: |
| 1612 | enabled: true |
| 1613 | driver: uio |
| 1614 | openvswitch: |
| 1615 | pmd_cpu_mask: "0x6" |
| 1616 | dpdk_socket_mem: "1024,1024" |
| 1617 | dpdk_lcore_mask: "0x400" |
| 1618 | memory_channels: "2" |
| 1619 | interface: |
| 1620 | eth3: |
| 1621 | enabled: true |
| 1622 | type: eth |
| 1623 | proto: manual |
| 1624 | name: ${_param:tenant_first_nic} |
| 1625 | eth4: |
| 1626 | enabled: true |
| 1627 | type: eth |
| 1628 | proto: manual |
| 1629 | name: ${_param:tenant_second_nic} |
| 1630 | dpdk0: |
| 1631 | name: ${_param:tenant_first_nic} |
| 1632 | pci: "0000:81:00.0" |
| 1633 | driver: igb_uio |
| 1634 | bond: bond1 |
| 1635 | enabled: true |
| 1636 | type: dpdk_ovs_port |
| 1637 | n_rxq: 2 |
| 1638 | dpdk1: |
| 1639 | name: ${_param:tenant_second_nic} |
| 1640 | pci: "0000:81:00.1" |
| 1641 | driver: igb_uio |
| 1642 | bond: bond1 |
| 1643 | enabled: true |
| 1644 | type: dpdk_ovs_port |
| 1645 | n_rxq: 2 |
| 1646 | bond1: |
| 1647 | enabled: true |
| 1648 | bridge: br-prv |
| 1649 | type: dpdk_ovs_bond |
| 1650 | mode: balance-slb |
| 1651 | br-prv: |
| 1652 | enabled: true |
| 1653 | type: dpdk_ovs_bridge |
| 1654 | tag: ${_param:tenant_vlan} |
| 1655 | address: ${_param:tenant_address} |
| 1656 | netmask: ${_param:tenant_network_netmask} |
| 1657 | |
Jakub Pavlik | aa75906 | 2017-03-13 15:57:26 +0100 | [diff] [blame] | 1658 | **DPDK OVS bridge for VXLAN** |
| 1659 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1660 | If VXLAN is used as tenant segmentation, IP address must |
| 1661 | be set on ``br-prv``. |
Jakub Pavlik | aa75906 | 2017-03-13 15:57:26 +0100 | [diff] [blame] | 1662 | |
| 1663 | .. code-block:: yaml |
| 1664 | |
| 1665 | linux: |
| 1666 | network: |
| 1667 | ... |
| 1668 | interface: |
| 1669 | br-prv: |
| 1670 | enabled: true |
| 1671 | type: dpdk_ovs_bridge |
| 1672 | address: 192.168.50.0 |
| 1673 | netmask: 255.255.255.0 |
Michael Polenchuk | d173d55 | 2018-01-22 15:22:47 +0400 | [diff] [blame] | 1674 | tag: 101 |
Jakub Pavlik | aa75906 | 2017-03-13 15:57:26 +0100 | [diff] [blame] | 1675 | mtu: 9000 |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1676 | |
Oleksii Chupryn | e2151ff | 2018-03-13 16:01:12 +0200 | [diff] [blame] | 1677 | **DPDK OVS bridge with Linux network interface** |
| 1678 | |
| 1679 | .. code-block:: yaml |
| 1680 | |
| 1681 | linux: |
| 1682 | network: |
| 1683 | ... |
| 1684 | interface: |
| 1685 | eth0: |
| 1686 | type: eth |
| 1687 | ovs_bridge: br-prv |
| 1688 | ... |
| 1689 | br-prv: |
| 1690 | enabled: true |
| 1691 | type: dpdk_ovs_bridge |
| 1692 | ... |
| 1693 | |
Jakub Pavlik | 21ca215 | 2017-02-27 22:21:09 +0100 | [diff] [blame] | 1694 | Linux storage |
| 1695 | ------------- |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1696 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1697 | Linux with mounted Samba: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1698 | |
| 1699 | .. code-block:: yaml |
| 1700 | |
| 1701 | linux: |
| 1702 | storage: |
| 1703 | enabled: true |
| 1704 | mount: |
| 1705 | samba1: |
Simon Pasquier | 376262a | 2016-11-16 15:21:51 +0100 | [diff] [blame] | 1706 | - enabled: true |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1707 | - path: /media/myuser/public/ |
| 1708 | - device: //192.168.0.1/storage |
| 1709 | - file_system: cifs |
| 1710 | - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm |
| 1711 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1712 | NFS mount: |
Jiri Broulik | b017f93 | 2017-03-31 13:55:36 +0200 | [diff] [blame] | 1713 | |
| 1714 | .. code-block:: yaml |
| 1715 | |
| 1716 | linux: |
| 1717 | storage: |
| 1718 | enabled: true |
| 1719 | mount: |
| 1720 | nfs_glance: |
| 1721 | enabled: true |
| 1722 | path: /var/lib/glance/images |
| 1723 | device: 172.16.10.110:/var/nfs/glance |
| 1724 | file_system: nfs |
| 1725 | opts: rw,sync |
| 1726 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1727 | File swap configuration: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1728 | |
| 1729 | .. code-block:: yaml |
| 1730 | |
| 1731 | linux: |
| 1732 | storage: |
| 1733 | enabled: true |
| 1734 | swap: |
| 1735 | file: |
| 1736 | enabled: true |
| 1737 | engine: file |
| 1738 | device: /swapfile |
| 1739 | size: 1024 |
| 1740 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1741 | Partition swap configuration: |
Lachlan Evenson | 3067651 | 2016-01-22 15:43:28 -0800 | [diff] [blame] | 1742 | |
| 1743 | .. code-block:: yaml |
| 1744 | |
| 1745 | linux: |
| 1746 | storage: |
| 1747 | enabled: true |
| 1748 | swap: |
| 1749 | partition: |
| 1750 | enabled: true |
| 1751 | engine: partition |
| 1752 | device: /dev/vg0/swap |
| 1753 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1754 | LVM group ``vg1`` with one device and ``data`` volume mounted |
| 1755 | into ``/mnt/data``. |
Filip Pytloun | c8a001a | 2015-12-15 14:09:19 +0100 | [diff] [blame] | 1756 | |
| 1757 | .. code-block:: yaml |
| 1758 | |
| 1759 | parameters: |
| 1760 | linux: |
| 1761 | storage: |
| 1762 | mount: |
| 1763 | data: |
Simon Pasquier | 376262a | 2016-11-16 15:21:51 +0100 | [diff] [blame] | 1764 | enabled: true |
Filip Pytloun | c8a001a | 2015-12-15 14:09:19 +0100 | [diff] [blame] | 1765 | device: /dev/vg1/data |
| 1766 | file_system: ext4 |
| 1767 | path: /mnt/data |
| 1768 | lvm: |
| 1769 | vg1: |
| 1770 | enabled: true |
| 1771 | devices: |
| 1772 | - /dev/sdb |
| 1773 | volume: |
| 1774 | data: |
| 1775 | size: 40G |
| 1776 | mount: ${linux:storage:mount:data} |
| 1777 | |
Jakub Pavlik | 4f74214 | 2017-08-08 15:05:50 +0200 | [diff] [blame] | 1778 | Create partitions on disk. Specify size in MB. It expects empty |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1779 | disk without any existing partitions. |
| 1780 | Set ``startsector=1`` if you want to start partitions from ``2048``. |
Jakub Pavlik | 4f74214 | 2017-08-08 15:05:50 +0200 | [diff] [blame] | 1781 | |
| 1782 | .. code-block:: yaml |
| 1783 | |
| 1784 | linux: |
| 1785 | storage: |
| 1786 | disk: |
| 1787 | first_drive: |
Piotr Kruk | d51911b | 2017-12-04 11:27:08 +0100 | [diff] [blame] | 1788 | startsector: 1 |
Jakub Pavlik | 4f74214 | 2017-08-08 15:05:50 +0200 | [diff] [blame] | 1789 | name: /dev/loop1 |
| 1790 | type: gpt |
| 1791 | partitions: |
| 1792 | - size: 200 #size in MB |
| 1793 | type: fat32 |
| 1794 | - size: 300 #size in MB |
Jakub Pavlik | 8e2140a | 2017-08-14 23:29:57 +0200 | [diff] [blame] | 1795 | mkfs: True |
| 1796 | type: xfs |
Jakub Pavlik | 4f74214 | 2017-08-08 15:05:50 +0200 | [diff] [blame] | 1797 | /dev/vda1: |
| 1798 | partitions: |
| 1799 | - size: 5 |
| 1800 | type: ext2 |
| 1801 | - size: 10 |
| 1802 | type: ext4 |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1803 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1804 | Multipath with Fujitsu Eternus DXL: |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1805 | |
| 1806 | .. code-block:: yaml |
| 1807 | |
| 1808 | parameters: |
| 1809 | linux: |
| 1810 | storage: |
| 1811 | multipath: |
| 1812 | enabled: true |
| 1813 | blacklist_devices: |
| 1814 | - /dev/sda |
| 1815 | - /dev/sdb |
| 1816 | backends: |
| 1817 | - fujitsu_eternus_dxl |
| 1818 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1819 | Multipath with Hitachi VSP 1000: |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1820 | |
| 1821 | .. code-block:: yaml |
| 1822 | |
| 1823 | parameters: |
| 1824 | linux: |
| 1825 | storage: |
| 1826 | multipath: |
| 1827 | enabled: true |
| 1828 | blacklist_devices: |
| 1829 | - /dev/sda |
| 1830 | - /dev/sdb |
| 1831 | backends: |
| 1832 | - hitachi_vsp1000 |
| 1833 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1834 | Multipath with IBM Storwize: |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1835 | |
| 1836 | .. code-block:: yaml |
| 1837 | |
| 1838 | parameters: |
| 1839 | linux: |
| 1840 | storage: |
| 1841 | multipath: |
| 1842 | enabled: true |
| 1843 | blacklist_devices: |
| 1844 | - /dev/sda |
| 1845 | - /dev/sdb |
| 1846 | backends: |
| 1847 | - ibm_storwize |
| 1848 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1849 | Multipath with multiple backends: |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1850 | |
| 1851 | .. code-block:: yaml |
| 1852 | |
| 1853 | parameters: |
| 1854 | linux: |
| 1855 | storage: |
| 1856 | multipath: |
| 1857 | enabled: true |
| 1858 | blacklist_devices: |
| 1859 | - /dev/sda |
| 1860 | - /dev/sdb |
| 1861 | - /dev/sdc |
| 1862 | - /dev/sdd |
| 1863 | backends: |
| 1864 | - ibm_storwize |
| 1865 | - fujitsu_eternus_dxl |
| 1866 | - hitachi_vsp1000 |
| 1867 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1868 | PAM LDAP integration: |
Dmitry Stremkouski | 7d8d67a | 2017-11-15 13:08:19 +0300 | [diff] [blame] | 1869 | |
| 1870 | .. code-block:: yaml |
| 1871 | |
| 1872 | parameters: |
| 1873 | linux: |
| 1874 | system: |
| 1875 | auth: |
| 1876 | enabled: true |
Dzmitry Stremkouski | 602735d | 2018-05-09 22:31:39 +0200 | [diff] [blame] | 1877 | mkhomedir: |
| 1878 | enabled: true |
| 1879 | umask: 0027 |
Dmitry Stremkouski | 7d8d67a | 2017-11-15 13:08:19 +0300 | [diff] [blame] | 1880 | ldap: |
| 1881 | enabled: true |
| 1882 | binddn: cn=bind,ou=service_users,dc=example,dc=com |
| 1883 | bindpw: secret |
| 1884 | uri: ldap://127.0.0.1 |
| 1885 | base: ou=users,dc=example,dc=com |
| 1886 | ldap_version: 3 |
| 1887 | pagesize: 65536 |
| 1888 | referrals: off |
| 1889 | filter: |
| 1890 | passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*)) |
| 1891 | shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*)) |
| 1892 | group: (&(objectClass=group)(gidNumber=*)) |
| 1893 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1894 | Disabled multipath (the default setup): |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1895 | |
| 1896 | .. code-block:: yaml |
| 1897 | |
| 1898 | parameters: |
| 1899 | linux: |
| 1900 | storage: |
| 1901 | multipath: |
| 1902 | enabled: false |
| 1903 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1904 | Linux with local loopback device: |
Simon Pasquier | 375001e | 2017-01-26 13:22:33 +0100 | [diff] [blame] | 1905 | |
| 1906 | .. code-block:: yaml |
| 1907 | |
| 1908 | linux: |
| 1909 | storage: |
| 1910 | loopback: |
| 1911 | disk1: |
| 1912 | file: /srv/disk1 |
| 1913 | size: 50G |
| 1914 | |
Filip Pytloun | b2c8f85 | 2016-11-21 17:03:43 +0100 | [diff] [blame] | 1915 | External config generation |
| 1916 | -------------------------- |
| 1917 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1918 | You are able to use config support metadata between formulas |
| 1919 | and only generate configuration files for external use, for example, Docker, and so on. |
Filip Pytloun | b2c8f85 | 2016-11-21 17:03:43 +0100 | [diff] [blame] | 1920 | |
| 1921 | .. code-block:: yaml |
| 1922 | |
| 1923 | parameters: |
| 1924 | linux: |
| 1925 | system: |
| 1926 | config: |
| 1927 | pillar: |
| 1928 | jenkins: |
| 1929 | master: |
| 1930 | home: /srv/volumes/jenkins |
| 1931 | approved_scripts: |
| 1932 | - method java.net.URL openConnection |
| 1933 | credentials: |
| 1934 | - type: username_password |
| 1935 | scope: global |
| 1936 | id: test |
| 1937 | desc: Testing credentials |
| 1938 | username: test |
| 1939 | password: test |
| 1940 | |
Vladimir Eremin | ccf2884 | 2017-04-10 23:52:10 +0300 | [diff] [blame] | 1941 | Netconsole Remote Kernel Logging |
| 1942 | -------------------------------- |
| 1943 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1944 | Netconsole logger can be configured for the configfs-enabled kernels |
| 1945 | (``CONFIG_NETCONSOLE_DYNAMIC`` must be enabled). The configuration |
| 1946 | applies both in runtime (if network is already configured), |
| 1947 | and on-boot after an interface initialization. |
Vladimir Eremin | ccf2884 | 2017-04-10 23:52:10 +0300 | [diff] [blame] | 1948 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1949 | .. note:: |
| 1950 | |
| 1951 | * Receiver can be located only on the same L3 domain |
| 1952 | (or you need to configure gateway MAC manually). |
| 1953 | * The Receiver MAC is detected only on configuration time. |
| 1954 | * Using broadcast MAC is not recommended. |
Vladimir Eremin | ccf2884 | 2017-04-10 23:52:10 +0300 | [diff] [blame] | 1955 | |
| 1956 | .. code-block:: yaml |
| 1957 | |
| 1958 | parameters: |
| 1959 | linux: |
| 1960 | system: |
| 1961 | netconsole: |
| 1962 | enabled: true |
| 1963 | port: 514 (optional) |
| 1964 | loglevel: debug (optional) |
| 1965 | target: |
| 1966 | 192.168.0.1: |
| 1967 | interface: bond0 |
| 1968 | mac: "ff:ff:ff:ff:ff:ff" (optional) |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 1969 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1970 | Usage |
| 1971 | ===== |
| 1972 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1973 | Set MTU of the eth0 network interface to 1400: |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1974 | |
| 1975 | .. code-block:: bash |
| 1976 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1977 | ip link set dev eth0 mtu 1400 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1978 | |
| 1979 | Read more |
| 1980 | ========= |
| 1981 | |
| 1982 | * https://www.archlinux.org/ |
| 1983 | * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 1984 | |
| 1985 | Documentation and Bugs |
| 1986 | ====================== |
| 1987 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1988 | * http://salt-formulas.readthedocs.io/ |
| 1989 | Learn how to install and update salt-formulas. |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 1990 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1991 | * https://github.com/salt-formulas/salt-formula-linux/issues |
| 1992 | In the unfortunate event that bugs are discovered, report the issue to the |
| 1993 | appropriate issue tracker. Use the Github issue tracker for a specific salt |
| 1994 | formula. |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 1995 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 1996 | * https://launchpad.net/salt-formulas |
| 1997 | For feature requests, bug reports, or blueprints affecting the entire |
| 1998 | ecosystem, use the Launchpad salt-formulas project. |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 1999 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 2000 | * https://launchpad.net/~salt-formulas-users |
| 2001 | Join the salt-formulas-users team and subscribe to mailing list if required. |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 2002 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 2003 | * https://github.com/salt-formulas/salt-formula-linux |
| 2004 | Develop the salt-formulas projects in the master branch and then submit pull |
| 2005 | requests against a specific formula. |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 2006 | |
OlgaGusarenko | 2828f5f | 2018-07-30 19:37:05 +0300 | [diff] [blame] | 2007 | * #salt-formulas @ irc.freenode.net |
| 2008 | Use this IRC channel in case of any questions or feedback which is always |
| 2009 | welcome. |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 2010 | |