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