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