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