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