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