blob: c1c4d3d9942b7c5a1a6baa9238daa38024f670f1 [file] [log] [blame]
Aleš Komárek63572992017-04-11 13:16:44 +02001============
2Linux Fomula
3============
Filip Pytlounf5383a42015-10-06 16:28:32 +02004
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03005Linux Operating Systems:
Filip Pytlounf5383a42015-10-06 16:28:32 +02006
7* Ubuntu
8* CentOS
9* RedHat
10* Fedora
11* Arch
12
Aleš Komárek63572992017-04-11 13:16:44 +020013Sample Pillars
Filip Pytlounf5383a42015-10-06 16:28:32 +020014==============
15
Aleš Komárek63572992017-04-11 13:16:44 +020016Linux System
Filip Pytlounf5383a42015-10-06 16:28:32 +020017------------
18
19Basic 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
azvyagintsev967af132017-06-12 12:25:24 +030033Linux with system users, some with password set:
OlgaGusarenko2828f5f2018-07-30 19:37:05 +030034
35.. warning:: If no ``password`` variable is passed,
36 any predifined password will be removed.
Filip Pytlounf5383a42015-10-06 16:28:32 +020037
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 Polreich4fcd5c02018-07-16 09:41:51 +020051 home_dir_mode: 755
Filip Pytlounf5383a42015-10-06 16:28:32 +020052 email: 'jonh@doe.com'
Dzmitry Stremkouskia0d8b2d2018-10-22 14:12:05 +020053 unique: false
Dzmitry Stremkouskifae59fb2018-11-21 10:10:10 +010054 groups:
55 - db-ops
56 - salt-ops
57 optional_groups:
58 - docker
Filip Pytlounf5383a42015-10-06 16:28:32 +020059 jsmith:
60 name: 'jsmith'
61 enabled: true
azvyagintsev967af132017-06-12 12:25:24 +030062 full_name: 'With clear password'
Filip Pytlounf5383a42015-10-06 16:28:32 +020063 home: '/home/jsmith'
azvyagintsev967af132017-06-12 12:25:24 +030064 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 Pytlounf5383a42015-10-06 16:28:32 +020078
Dzmitry Stremkouskia2960ad2019-09-04 14:15:09 +020079Remove users data completely:
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 Teselkinc7814732019-02-21 16:40:23 +030093Setting user defaults
94---------------------
95Default parameters that will be used by `useradd` command could be configured
96the 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
113Other parameters that are used when creating user profile could be configured
114as 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 Teselkin47e41f42018-09-27 14:10:09 +0300137Configure password expiration parameters
138----------------------------------------
139The following login.defs parameters can be overridden per-user:
140
141* PASS_MAX_DAYS
142* PASS_MIN_DAYS
143* PASS_WARN_DAYS
Dmitry Teselkin47e41f42018-09-27 14:10:09 +0300144
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 Teselkinc7814732019-02-21 16:40:23 +0300157 warndays: <PASS_WARN_AGE>
Dmitry Teselkin47e41f42018-09-27 14:10:09 +0300158
Petr Michalec1c4c8d82017-02-28 19:09:21 +0100159Configure sudo for users and groups under ``/etc/sudoers.d/``.
160This ways ``linux.system.sudo`` pillar map to actual sudo attributes:
161
162.. code-block:: jinja
Aleš Komárek63572992017-04-11 13:16:44 +0200163
Petr Michalec1c4c8d82017-02-28 19:09:21 +0100164 # 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 Michalec1c4c8d82017-02-28 19:09:21 +0100172.. code-block:: yaml
Aleš Komárek63572992017-04-11 13:16:44 +0200173
Petr Michalec1c4c8d82017-02-28 19:09:21 +0100174 linux:
175 system:
176 sudo:
177 enabled: true
Tomas Kammd8eb3002017-05-08 19:30:29 +0200178 aliases:
Petr Michalec1c4c8d82017-02-28 19:09:21 +0100179 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 Josef7a9d9b92017-05-16 11:39:01 +0200262 setenv: true # Enable sudo -E option
Petr Michalec1c4c8d82017-02-28 19:09:21 +0100263 runas:
264 - DBA
265 commands:
266 - ALL
267 - '!SUPPORT_SHELLS'
268 - '!SUPPORT_RESTRICTED'
269
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300270Linux with package, latest version:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200271
272.. code-block:: yaml
273
274 linux:
275 system:
276 ...
277 package:
278 package-name:
279 version: latest
280
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300281Linux with package from certail repo, version with no upgrades:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200282
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
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300294Linux with package from certail repo, version with no GPG
295verification:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200296
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
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300308Linux with autoupdates (automatically install security package
309updates):
Bruno Binet69a9d8d2017-02-16 22:34:32 +0100310
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 Teselkin0f084a02018-08-29 14:46:38 +0300324Managing cron tasks
325-------------------
326
327There are two data structures that are related to managing cron itself and
328cron tasks:
329
330.. code-block:: yaml
331
332 linux:
333 system:
334 cron:
335
336and
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
347a 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
363To 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
367A 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.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300372
373By default, it will use name as an identifier, unless identifier key is
Filip Pytloun91222222017-08-04 10:55:27 +0200374explicitly set or False (then it will use Salt's default behavior which is
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300375identifier same as command resulting in not being able to change it):
Filip Pytlounf5383a42015-10-06 16:28:32 +0200376
377.. code-block:: yaml
378
379 linux:
380 system:
381 ...
382 job:
383 cmd1:
384 command: '/cmd/to/run'
Filip Pytloun91222222017-08-04 10:55:27 +0200385 identifier: cmd1
Filip Pytlounf5383a42015-10-06 16:28:32 +0200386 enabled: true
387 user: 'root'
388 hour: 2
389 minute: 0
390
Dmitry Teselkin0f084a02018-08-29 14:46:38 +0300391Managing 'at' tasks
392-------------------
393
394Pillar 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
408To 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
412A 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 Pytlound0a29e72015-11-30 15:23:34 +0100417Linux 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
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300433Enable autologin on ``tty1`` (may work only for Ubuntu 14.04):
Filip Pytloun7fee0542015-10-15 11:19:24 +0200434
435.. code-block:: yaml
436
437 linux:
438 system:
439 console:
440 tty1:
441 autologin: root
Filip Pytloun281d0202016-01-29 14:03:51 +0100442 # Enable serial console
443 ttyS0:
444 autologin: root
445 rate: 115200
446 term: xterm
Filip Pytloun7fee0542015-10-15 11:19:24 +0200447
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300448To disable set autologin to ``false``.
Filip Pytloun7fee0542015-10-15 11:19:24 +0200449
Filip Pytloun7731b852016-02-01 11:13:47 +0100450Set ``policy-rc.d`` on Debian-based systems. Action can be any available
451command in ``while true`` loop and ``case`` context.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300452Following will disallow dpkg to stop/start services for the Cassandra
453package automatically:
Filip Pytloun7731b852016-02-01 11:13:47 +0100454
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 Pytlounc49445a2016-04-04 14:23:20 +0200465Set system locales:
466
467.. code-block:: yaml
468
469 linux:
470 system:
471 locale:
472 en_US.UTF-8:
473 default: true
Filip Pytlounee1745f2016-04-04 17:39:41 +0200474 "cs_CZ.UTF-8 UTF-8":
Filip Pytlounc49445a2016-04-04 14:23:20 +0200475 enabled: true
476
Andrey Shestakove7cca052017-05-24 23:06:24 +0300477Systemd 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 Pytloun8b2131e2017-11-08 13:29:03 +0100494Ensure 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
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300507Ensure presence of file by specifying its source:
Richard Felkl2e07d652018-01-19 10:19:06 +0100508
509.. code-block:: yaml
510
511 linux:
512 system:
513 file:
514 /tmp/test.txt:
515 source: http://example.com/test.txt
Richard Felklf40599a2018-02-06 22:56:41 +0100516 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 Felkl2e07d652018-01-19 10:19:06 +0100530
Gabor Orosz35815c02018-09-07 17:31:05 +0200531 linux:
532 system:
533 file:
534 test2:
535 name: /tmp/test2.txt
536 source: http://example.com/test2.jinja
537 template: jinja
538
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300539Ensure presence of file by specifying its contents:
Richard Felkl2e07d652018-01-19 10:19:06 +0100540
541.. code-block:: yaml
542
543 linux:
544 system:
545 file:
546 /tmp/test.txt:
547 contents: |
548 line1
549 line2
Richard Felklf40599a2018-02-06 22:56:41 +0100550
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 Berezovskiy25e177d2019-07-22 13:14:14 +0400563Ensure 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
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300585Ensure presence of file to be serialized through one of the
586serializer modules (see:
587https://docs.saltstack.com/en/latest/ref/serializers/all/index.html):
Bruno Binet9c2fe222018-06-08 16:57:32 +0200588
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
Filip Pytloun281034a2016-01-04 18:06:22 +0100600Kernel
601~~~~~~
602
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300603Install always up to date LTS kernel and headers from Ubuntu Trusty:
Filip Pytloun281034a2016-01-04 18:06:22 +0100604
605.. code-block:: yaml
606
607 linux:
608 system:
609 kernel:
610 type: generic
611 lts: trusty
612 headers: true
613
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300614Load kernel modules and add them to ``/etc/modules``:
Tomáš Kukrálba35b212017-02-15 17:59:46 +0100615
616.. code-block:: yaml
617
618 linux:
619 system:
620 kernel:
621 modules:
622 - nf_conntrack
623 - tp_smapi
624 - 8021q
625
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300626Configure or blacklist kernel modules with additional options to
627``/etc/modprobe.d`` following example will add
628``/etc/modprobe.d/nf_conntrack.conf`` file with line
629``options nf_conntrack hashsize=262144``:
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300630
Dmitry Teselkin809834c2018-08-13 19:14:42 +0300631'option' can be a mapping (with 'enabled' and 'value' keys) or a scalar.
632
633Example for 'scalar' option value:
634
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300635.. code-block:: yaml
636
637 linux:
638 system:
639 kernel:
640 module:
641 nf_conntrack:
642 option:
643 hashsize: 262144
644
Dmitry Teselkin809834c2018-08-13 19:14:42 +0300645Example for 'mapping' option value:
646
647.. code-block:: yaml
648
649 linux:
650 system:
651 kernel:
652 module:
653 nf_conntrack:
654 option:
655 hashsize:
656 enabled: true
657 value: 262144
658
659NOTE: 'enabled' key is optional and is True by default.
660
661Blacklist a module:
662
663.. code-block:: yaml
664
665 linux:
666 system:
667 kernel:
668 module:
669 nf_conntrack:
670 blacklist: true
671
672A module can have a number of aliases, wildcards are allowed.
673Define an alias for a module:
674
675.. code-block:: yaml
676
677 linux:
678 system:
679 kernel:
680 module:
681 nf_conntrack:
682 alias:
683 nfct:
684 enabled: true
685 "nf_conn*":
686 enabled: true
687
688NOTE: 'enabled' key is mandatory as there are no other keys exist.
689
690Execute custom command instead of 'insmod' when inserting a module:
691
692.. code-block:: yaml
693
694 linux:
695 system:
696 kernel:
697 module:
698 nf_conntrack:
699 install:
700 enabled: true
701 command: /bin/true
702
703NOTE: 'enabled' key is optional and is True by default.
704
705Execute custom command instead of 'rmmod' when removing a module:
706
707.. code-block:: yaml
708
709 linux:
710 system:
711 kernel:
712 module:
713 nf_conntrack:
714 remove:
715 enabled: true
716 command: /bin/true
717
718NOTE: 'enabled' key is optional and is True by default.
719
720Define module dependencies:
721
722.. code-block:: yaml
723
724 linux:
725 system:
726 kernel:
727 module:
728 nf_conntrack:
729 softdep:
730 pre:
731 1:
732 enabled: true
733 value: a
734 2:
735 enabled: true
736 value: b
737 3:
738 enabled: true
739 value: c
740 post:
741 1:
742 enabled: true
743 value: x
744 2:
745 enabled: true
746 value: y
747 3:
748 enabled: true
749 value: z
750
751NOTE: 'enabled' key is optional and is True by default.
752
753
Filip Pytloun281034a2016-01-04 18:06:22 +0100754Install specific kernel version and ensure all other kernel packages are
755not present. Also install extra modules and headers for this kernel:
756
757.. code-block:: yaml
758
759 linux:
760 system:
761 kernel:
762 type: generic
763 extra: true
764 headers: true
765 version: 4.2.0-22
766
Denis Egorenko567aa202019-11-06 14:02:00 +0400767Also it is possible to install Kernel with Hardware Enablement or virtual
768kernel packages. For example, for Xenial:
769
770.. code-block:: yaml
771
772 linux:
773 system:
774 kernel:
775 type: generic
776 extra: true
777 headers: true
778 version: 4.15.0-65
779 hwe:
780 type: hwe
781 version: 16.04
782 kernel_version: 4.15.0.65
783
784Set `linux:system:kernel:hwe:type:virtual` if you need Virtual kernel packages.
785
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300786Systcl kernel parameters:
Jakub Pavlik32c2cb02016-01-29 12:45:29 +0100787
788.. code-block:: yaml
789
790 linux:
791 system:
792 kernel:
793 sysctl:
794 net.ipv4.tcp_keepalive_intvl: 3
795 net.ipv4.tcp_keepalive_time: 30
796 net.ipv4.tcp_keepalive_probes: 8
797
Michael Polenchukebf55522018-01-25 13:22:39 +0400798Configure kernel boot options:
799
800.. code-block:: yaml
801
802 linux:
803 system:
804 kernel:
805 boot_options:
806 - elevator=deadline
807 - spectre_v2=off
808 - nopti
809
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100810CPU
811~~~
812
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300813Enable cpufreq governor for every cpu:
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100814
815.. code-block:: yaml
816
817 linux:
818 system:
819 cpu:
820 governor: performance
821
Nick Metzf04f5f32018-01-08 15:25:04 +0100822
Jiri Broulik303905d2018-01-11 14:12:48 +0100823CGROUPS
824~~~~~~~
825
826Setup linux cgroups:
827
828.. code-block:: yaml
829
830 linux:
831 system:
832 cgroup:
833 enabled: true
834 group:
835 ceph_group_1:
836 controller:
837 cpu:
838 shares:
839 value: 250
840 cpuacct:
841 usage:
842 value: 0
843 cpuset:
844 cpus:
845 value: 1,2,3
846 memory:
847 limit_in_bytes:
848 value: 2G
849 memsw.limit_in_bytes:
850 value: 3G
851 mapping:
852 subjects:
853 - '@ceph'
854 generic_group_1:
855 controller:
856 cpu:
857 shares:
858 value: 250
859 cpuacct:
860 usage:
861 value: 0
862 mapping:
863 subjects:
864 - '*:firefox'
865 - 'student:cp'
866
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300867Shared libraries
Nick Metzf04f5f32018-01-08 15:25:04 +0100868~~~~~~~~~~~~~~~~
869
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300870Set additional shared library to Linux system library path:
Nick Metzf04f5f32018-01-08 15:25:04 +0100871
872.. code-block:: yaml
873
874 linux:
875 system:
876 ld:
877 library:
878 java:
879 - /usr/lib/jvm/jre-openjdk/lib/amd64/server
880 - /opt/java/jre/lib/amd64/server
Ondrej Smolaef9bd762018-07-11 14:26:02 +0200881
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200882Certificates
883~~~~~~~~~~~~
884
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300885Add certificate authority into system trusted CA bundle:
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200886
887.. code-block:: yaml
888
889 linux:
890 system:
891 ca_certificates:
892 mycert: |
893 -----BEGIN CERTIFICATE-----
894 MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
895 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
896 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
897 MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
898 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
899 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
900 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
901 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
902 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
903 CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
904 lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
905 AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
906 -----END CERTIFICATE-----
907
Filip Pytloun361096c2017-08-23 10:57:20 +0200908Sysfs
909~~~~~
910
911Install sysfsutils and set sysfs attributes:
912
913.. code-block:: yaml
914
915 linux:
916 system:
917 sysfs:
918 scheduler:
919 block/sda/queue/scheduler: deadline
920 power:
921 mode:
922 power/state: 0660
923 owner:
924 power/state: "root:power"
925 devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
926
Ondrej Smolaef9bd762018-07-11 14:26:02 +0200927Optional: You can also use list that will ensure order of items.
928
929.. code-block:: yaml
930
931 linux:
932 system:
933 sysfs:
934 scheduler:
935 block/sda/queue/scheduler: deadline
936 power:
937 - mode:
938 power/state: 0660
939 - owner:
940 power/state: "root:power"
941 - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
942
Martin Polreich148e1b82018-09-13 15:54:25 +0200943Sysfs definition with disabled automatic write. Attributes are saved
944to configuration, but are not applied during the run.
945Thay will be applied automatically after the reboot.
946
947
948.. code-block:: yaml
949
950 linux:
951 system:
952 sysfs:
953 enable_apply: false
954 scheduler:
955 block/sda/queue/scheduler: deadline
956
957.. note:: The `enable_apply` parameter defaults to `True` if not defined.
958
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100959Huge Pages
960~~~~~~~~~~~~
961
962Huge Pages give a performance boost to applications that intensively deal
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300963with memory allocation/deallocation by decreasing memory fragmentation:
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100964
965.. code-block:: yaml
966
967 linux:
968 system:
969 kernel:
970 hugepages:
971 small:
972 size: 2M
973 count: 107520
974 mount_point: /mnt/hugepages_2MB
Michael Polenchukd9369fe2018-05-08 17:53:08 +0400975 mount: false/true # default is true (mount immediately) / false (just save in the fstab)
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100976 large:
977 default: true # default automatically mounted
978 size: 1G
979 count: 210
980 mount_point: /mnt/hugepages_1GB
981
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300982.. note:: Not recommended to use both pagesizes concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100983
Jakub Pavlik5398d872017-02-13 22:30:47 +0100984Intel SR-IOV
985~~~~~~~~~~~~
986
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300987PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV)
988specification defines a standardized mechanism to virtualize
989PCIe devices. The mechanism can virtualize a single PCIe
990Ethernet controller to appear as multiple PCIe devices:
Jakub Pavlik5398d872017-02-13 22:30:47 +0100991
992.. code-block:: yaml
993
994 linux:
995 system:
996 kernel:
997 sriov: True
998 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
999 rc:
1000 local: |
1001 #!/bin/sh -e
1002 # Enable 7 VF on eth1
1003 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
1004 exit 0
1005
Jakub Pavlik6c9ead12017-02-16 21:53:13 +01001006Isolate CPU options
1007~~~~~~~~~~~~~~~~~~~
1008
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001009Remove the specified CPUs, as defined by the cpu_number values, from
1010the general kernel SMP balancing and scheduler algroithms. The only
1011way to move a process onto or off an *isolated* CPU is via the CPU
1012affinity syscalls. ``cpu_number begins`` at ``0``, so the
1013maximum value is ``1`` less than the number of CPUs on the system.:
Jakub Pavlik6c9ead12017-02-16 21:53:13 +01001014
1015.. code-block:: yaml
1016
1017 linux:
1018 system:
1019 kernel:
1020 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +01001021
Filip Pytlounf5383a42015-10-06 16:28:32 +02001022Repositories
1023~~~~~~~~~~~~
1024
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001025RedHat-based Linux with additional OpenStack repo:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001026
1027.. code-block:: yaml
1028
1029 linux:
1030 system:
1031 ...
1032 repo:
1033 rdo-icehouse:
1034 enabled: true
1035 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
1036 pgpcheck: 0
1037
1038Ensure system repository to use czech Debian mirror (``default: true``)
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001039Also pin it's packages with priority ``900``:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001040
1041.. code-block:: yaml
1042
1043 linux:
1044 system:
1045 repo:
1046 debian:
1047 default: true
1048 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
1049 # Import signing key from URL if needed
1050 key_url: "http://dummy.com/public.gpg"
1051 pin:
1052 - pin: 'origin "ftp.cz.debian.org"'
1053 priority: 900
1054 package: '*'
1055
azvyagintseva3a73d02018-12-06 14:49:58 +02001056Sometimes better to use one pining rule file, to decrease mistaken
1057ordering. You can use those option ``system:apt:preferences``, which would add opts into
1058``/etc/apt/preferences`` file:
1059
1060.. code-block:: yaml
1061
1062 parameters:
1063 linux:
1064 system:
1065 apt:
1066 preferences:
1067 enabled: true
1068 rules:
1069 100:
1070 enabled: true
1071 name: 'some origin pin'
1072 pin: 'release o=Debian'
1073 priority: 1100
1074 package: '*'
1075
1076
azvyagintsev4494a472018-09-14 19:19:23 +03001077If you need to add multiple pin rules for one repo, please use new,ordered definition format
1078('pinning' definition will be in priotity to use):
1079
1080.. code-block:: yaml
1081
1082 linux:
1083 system:
1084 repo:
1085 mcp_saltstack:
1086 source: "deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main"
1087 architectures: amd64
1088 clean_file: true
1089 pinning:
1090 10:
1091 enabled: true
1092 pin: 'release o=SaltStack'
1093 priority: 50
1094 package: 'libsodium18'
1095 20:
1096 enabled: true
1097 pin: 'release o=SaltStack'
1098 priority: 1100
1099 package: '*'
1100
1101
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001102.. note:: For old Ubuntu releases (<xenial)
azvyagintsevff089d22018-07-27 16:52:34 +02001103 extra packages for apt transport, like ``apt-transport-https``
1104 may be required to be installed manually.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001105 (Chicken-eggs issue: we need to install packages to
azvyagintsevff089d22018-07-27 16:52:34 +02001106 reach repo from where they should be installed)
1107 Otherwise, you still can try 'fortune' and install prereq.packages before
1108 any repo configuration, using list of requires in map.jinja.
1109
1110
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001111Disabling any prerequisite packages installation:
1112
azvyagintsevff089d22018-07-27 16:52:34 +02001113You can simply drop any package pre-installation (before system.linux.repo
1114will be processed) via cluster lvl:
1115
1116.. code-block:: yaml
1117
1118 linux:
1119 system:
1120 pkgs: ~
1121
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001122Package manager proxy global setup:
Petr Michalec10462bb2017-03-23 19:18:08 +01001123
1124.. code-block:: yaml
1125
1126 linux:
1127 system:
1128 ...
1129 repo:
1130 apt-mk:
1131 source: "deb http://apt-mk.mirantis.com/ stable main salt"
1132 ...
1133 proxy:
1134 pkg:
1135 enabled: true
1136 ftp: ftp://ftp-proxy-for-apt.host.local:2121
1137 ...
1138 # NOTE: Global defaults for any other componet that configure proxy on the system.
1139 # If your environment has just one simple proxy, set it on linux:system:proxy.
1140 #
1141 # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
1142 # as for https and http
1143 ftp: ftp://proxy.host.local:2121
1144 http: http://proxy.host.local:3142
1145 https: https://proxy.host.local:3143
1146
1147Package manager proxy setup per repository:
1148
1149.. code-block:: yaml
1150
1151 linux:
1152 system:
1153 ...
1154 repo:
1155 debian:
1156 source: "deb http://apt-mk.mirantis.com/ stable main salt"
1157 ...
1158 apt-mk:
1159 source: "deb http://apt-mk.mirantis.com/ stable main salt"
1160 # per repository proxy
1161 proxy:
1162 enabled: true
1163 http: http://maas-01:8080
1164 https: http://maas-01:8080
1165 ...
1166 proxy:
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001167 # package manager fallback defaults
Petr Michalec10462bb2017-03-23 19:18:08 +01001168 # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
1169 pkg:
1170 enabled: true
1171 ftp: ftp://proxy.host.local:2121
1172 #http: http://proxy.host.local:3142
1173 #https: https://proxy.host.local:3143
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001174 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001175 # global system fallback system defaults
1176 ftp: ftp://proxy.host.local:2121
1177 http: http://proxy.host.local:3142
1178 https: https://proxy.host.local:3143
1179
Ivan Berezovskiycfd58a22019-06-25 20:15:51 +04001180
1181Add secured apt repository:
1182
1183.. code-block:: yaml
1184
1185 linux:
1186 system:
1187 ...
1188 repo:
1189 test:
1190 secure: true
1191 url: example.org/ubuntu
1192 arch: deb
1193 protocol: http
1194 user: foo
1195 password: bar
1196 distribution: stable
1197 component: main
1198
1199Add multiply secured apt repositories with same credentials:
1200
1201.. code-block:: yaml
1202
1203 linux:
1204 system:
1205 ...
1206 common_repo_secured:
1207 arch: deb
1208 protocol: http
1209 user: foo
1210 password: bar
1211 distribution: stable
1212 component: main
1213 repo:
1214 test1:
1215 secure: true
1216 url: example1.org/ubuntu
1217 test2:
1218 secure: true
1219 url: example2.org/ubuntu
1220
Jiri Broulik34a29b42017-04-25 14:42:54 +02001221Remove all repositories:
1222
1223.. code-block:: yaml
1224
1225 linux:
1226 system:
1227 purge_repos: true
1228
azvyagintsevff089d22018-07-27 16:52:34 +02001229Refresh repositories metada, after configuration:
1230
1231.. code-block:: yaml
1232
1233 linux:
1234 system:
1235 refresh_repos_meta: true
1236
Filip Pytlounc512e6c2017-11-22 14:28:10 +01001237Setup custom apt config options:
1238
1239.. code-block:: yaml
1240
1241 linux:
1242 system:
1243 apt:
1244 config:
1245 compression-workaround:
1246 "Acquire::CompressionTypes::Order": "gz"
1247 docker-clean:
1248 "DPkg::Post-Invoke":
1249 - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
1250 "APT::Update::Post-Invoke":
1251 - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
Jiri Broulik34a29b42017-04-25 14:42:54 +02001252
Petr Michalec10462bb2017-03-23 19:18:08 +01001253RC
1254~~
1255
Jakub Pavlik78859382016-01-21 11:26:39 +01001256rc.local example
1257
1258.. code-block:: yaml
1259
1260 linux:
1261 system:
1262 rc:
1263 local: |
1264 #!/bin/sh -e
1265 #
1266 # rc.local
1267 #
1268 # This script is executed at the end of each multiuser runlevel.
1269 # Make sure that the script will "exit 0" on success or any other
1270 # value on error.
1271 #
1272 # In order to enable or disable this script just change the execution
1273 # bits.
1274 #
1275 # By default this script does nothing.
1276 exit 0
1277
Filip Pytloun1f40dac2016-01-22 15:52:57 +01001278Prompt
1279~~~~~~
1280
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001281Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``.
1282Every user can have different prompt:
Filip Pytloun1f40dac2016-01-22 15:52:57 +01001283
1284.. code-block:: yaml
1285
1286 linux:
1287 system:
1288 prompt:
1289 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\\]
1290 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
1291
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001292On Debian systems, to set prompt system-wide, it's necessary to
1293remove setting PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc``,
1294which comes from ``/etc/skel/.bashrc``. This formula will do
1295this automatically, but will not touch existing user's
1296``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +01001297
Filip Pytlouneef11c12016-03-25 11:00:23 +01001298Bash
1299~~~~
1300
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001301Fix bash configuration to preserve history across sessions
1302like ZSH does by default:
Filip Pytlouneef11c12016-03-25 11:00:23 +01001303
1304.. code-block:: yaml
1305
1306 linux:
1307 system:
1308 bash:
1309 preserve_history: true
1310
Dmitry Teselkin949398e2018-05-03 15:50:00 +03001311Login banner message
1312~~~~~~~~~~~~~~~~~~~~
1313
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001314``/etc/issue`` is a text file which contains a message or system
1315identification to be printed before the login prompt. It may contain
Dmitry Teselkin949398e2018-05-03 15:50:00 +03001316various @char and \char sequences, if supported by the getty-type
1317program employed on the system.
1318
1319Setting logon banner message is easy:
1320
1321.. code-block:: yaml
1322
1323 liunx:
1324 system:
1325 banner:
1326 enabled: true
1327 contents: |
1328 UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
1329
1330 You must have explicit, authorized permission to access or configure this
1331 device. Unauthorized attempts and actions to access or use this system may
1332 result in civil and/or criminal penalties.
1333 All activities performed on this system are logged and monitored.
1334
Filip Pytloune874dfb2016-01-22 16:57:34 +01001335Message of the day
1336~~~~~~~~~~~~~~~~~~
1337
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001338``pam_motd`` from package ``libpam-modules`` is used for dynamic
1339messages of the day. Setting custom ``motd`` will clean up existing ones.
Filip Pytloune874dfb2016-01-22 16:57:34 +01001340
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001341Setting static ``motd`` will replace existing ``/etc/motd`` and remove
1342scripts from ``/etc/update-motd.d``.
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001343
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001344Setting static ``motd``:
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001345
1346.. code-block:: yaml
1347
1348 linux:
1349 system:
1350 motd: |
1351 UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
1352
1353 You must have explicit, authorized permission to access or configure this
1354 device. Unauthorized attempts and actions to access or use this system may
1355 result in civil and/or criminal penalties.
1356 All activities performed on this system are logged and monitored.
1357
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001358Setting dynamic ``motd``:
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001359
Filip Pytloune874dfb2016-01-22 16:57:34 +01001360.. code-block:: yaml
1361
1362 linux:
1363 system:
1364 motd:
1365 - release: |
1366 #!/bin/sh
1367 [ -r /etc/lsb-release ] && . /etc/lsb-release
1368
1369 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
1370 # Fall back to using the very slow lsb_release utility
1371 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
1372 fi
1373
1374 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
1375 - warning: |
1376 #!/bin/sh
1377 printf "This is [company name] network.\n"
1378 printf "Unauthorized access strictly prohibited.\n"
1379
Marek Celoud713e9072017-05-18 15:20:25 +02001380Services
1381~~~~~~~~
1382
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001383Stop and disable the ``linux`` service:
Marek Celoud713e9072017-05-18 15:20:25 +02001384
1385.. code-block:: yaml
1386
1387 linux:
1388 system:
1389 service:
1390 apt-daily.timer:
1391 status: dead
1392
Dzmitry Stremkouski70d09782018-11-30 16:04:59 +01001393Override systemd service unit:
1394
1395.. code-block:: yaml
1396
1397 parameters:
1398
1399 linux:
1400 system:
1401 service:
1402 tgt:
1403 name: tgt
1404 status: running
1405 enabled: True
1406 override:
1407 50:
1408 target: tgt.service.d
1409 name: bind
1410 content: |
1411 [Service]
1412 ExecStart=
1413 ExecStart=/usr/sbin/tgtd -f --iscsi portal=${_param:single_address}:3260
1414
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001415Possible statuses are ``dead`` (disable service by default), ``running``
1416(enable service by default), ``enabled``, ``disabled``:
Marek Celoud713e9072017-05-18 15:20:25 +02001417
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001418Linux with the ``atop`` service:
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +03001419
1420.. code-block:: yaml
1421
1422 linux:
1423 system:
1424 atop:
1425 enabled: true
1426 interval: 20
1427 logpath: "/var/log/atop"
1428 outfile: "/var/log/atop/daily.log"
1429
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001430Linux with the ``mcelog`` service:
Oleksii Chupryn144432b2018-05-22 10:34:48 +03001431
1432.. code-block:: yaml
1433
1434 linux:
1435 system:
1436 mcelog:
1437 enabled: true
1438 logging:
1439 syslog: true
1440 syslog_error: true
1441
Filip Pytloun2f70b492016-02-19 15:55:25 +01001442RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +01001443^^^^^^^^^^^^^
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001444Currently, ``update-motd`` is not available
1445for RHEL. So there is no native support for dynamic ``motd``.
1446You can still set a static one, with a different pillar structure:
Filip Pytloun2f70b492016-02-19 15:55:25 +01001447
1448.. code-block:: yaml
1449
1450 linux:
1451 system:
1452 motd: |
1453 This is [company name] network.
1454 Unauthorized access strictly prohibited.
1455
Filip Pytloun8296bb92016-02-19 18:42:09 +01001456Haveged
1457~~~~~~~
1458
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001459If you are running headless server and are low on entropy,
1460you may set up Haveged:
Filip Pytloun8296bb92016-02-19 18:42:09 +01001461
1462.. code-block:: yaml
1463
1464 linux:
1465 system:
1466 haveged:
1467 enabled: true
1468
Filip Pytlounf5383a42015-10-06 16:28:32 +02001469Linux network
1470-------------
1471
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001472Linux with network manager:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001473
1474.. code-block:: yaml
1475
1476 linux:
1477 network:
1478 enabled: true
1479 network_manager: true
1480
Dzmitry Stremkouski00cdbe62018-10-31 16:41:54 +01001481Execute linux.network.interface state without ifupdown activity:
1482
1483.. code-block:: bash
1484
1485 salt-call linux.network.interface pillar='{"linux":{"network":{"noifupdown":True}}}'
1486
1487
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001488Linux with default static network interfaces, default gateway
1489interface and DNS servers:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001490
1491.. code-block:: yaml
1492
1493 linux:
1494 network:
1495 enabled: true
1496 interface:
1497 eth0:
1498 enabled: true
1499 type: eth
1500 address: 192.168.0.102
1501 netmask: 255.255.255.0
1502 gateway: 192.168.0.1
1503 name_servers:
1504 - 8.8.8.8
1505 - 8.8.4.4
1506 mtu: 1500
1507
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001508Linux with bonded interfaces and disabled ``NetworkManager``:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001509
1510.. code-block:: yaml
1511
1512 linux:
1513 network:
1514 enabled: true
1515 interface:
1516 eth0:
1517 type: eth
1518 ...
1519 eth1:
1520 type: eth
1521 ...
1522 bond0:
1523 enabled: true
1524 type: bond
1525 address: 192.168.0.102
1526 netmask: 255.255.255.0
1527 mtu: 1500
1528 use_in:
1529 - interface: ${linux:interface:eth0}
1530 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +01001531 network_manager:
1532 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001533
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001534Linux with VLAN ``interface_params``:
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001535
1536.. code-block:: yaml
1537
1538 linux:
1539 network:
1540 enabled: true
1541 interface:
1542 vlan69:
1543 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +01001544 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001545 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001546
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001547Linux with wireless interface parameters:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001548
1549.. code-block:: yaml
1550
1551 linux:
1552 network:
1553 enabled: true
1554 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001555 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +02001556 interface:
1557 wlan0:
1558 type: eth
1559 wireless:
1560 essid: example
1561 key: example_key
1562 security: wpa
1563 priority: 1
1564
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001565Linux networks with routes defined:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001566
1567.. code-block:: yaml
1568
1569 linux:
1570 network:
1571 enabled: true
1572 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001573 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +02001574 interface:
1575 eth0:
1576 type: eth
1577 route:
1578 default:
1579 address: 192.168.0.123
1580 netmask: 255.255.255.0
1581 gateway: 192.168.0.1
1582
ivce5011da2019-01-23 07:56:53 +03001583Linux networks with implicit routes definition:
1584
1585- on node 1:
1586
1587.. code-block:: yaml
1588
1589 linux:
1590 network:
1591 enabled: true
1592 router:
1593 ctl:
1594 # router that connects 10.0.1.0/24 and 10.0.2.0/24
1595 addresses:
1596 - 10.0.1.1/24
1597 - 10.0.2.1/24
1598 test:
1599 addresses:
1600 - 10.0.1.2/24
1601 networks:
1602 - 10.100.0.0/16
1603 interface:
1604 ctl:
1605 name: eth0
1606 address: 10.0.1.101
1607 netmask: 255.255.255.0
1608
1609- on node2:
1610
1611.. code-block:: yaml
1612
1613 linux:
1614 network:
1615 enabled: true
1616 router:
1617 ctl:
1618 # equivalent of node1's ctl router with 'implicit_routes = false'
1619 options:
1620 implicit_routes: false
1621 addresses:
1622 - 10.0.1.1/24
1623 - 10.0.2.1/24
1624 networks:
1625 - 10.0.1.0/24
1626 - 10.0.2.0/24
1627 interface:
1628 ctl:
1629 name: eth0
1630 address: 10.0.2.101
1631 netmask: 255.255.255.0
1632
1633
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001634Native Linux Bridges:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001635
1636.. code-block:: yaml
1637
1638 linux:
1639 network:
1640 interface:
1641 eth1:
1642 enabled: true
1643 type: eth
1644 proto: manual
1645 up_cmds:
1646 - ip address add 0/0 dev $IFACE
1647 - ip link set $IFACE up
1648 down_cmds:
1649 - ip link set $IFACE down
1650 br-ex:
1651 enabled: true
1652 type: bridge
1653 address: ${linux:network:host:public_local:address}
1654 netmask: 255.255.255.0
1655 use_interfaces:
1656 - eth1
1657
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001658Open vSwitch Bridges:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001659
1660.. code-block:: yaml
1661
1662 linux:
1663 network:
1664 bridge: openvswitch
1665 interface:
1666 eth1:
1667 enabled: true
1668 type: eth
1669 proto: manual
1670 up_cmds:
1671 - ip address add 0/0 dev $IFACE
1672 - ip link set $IFACE up
1673 down_cmds:
1674 - ip link set $IFACE down
1675 br-ex:
1676 enabled: true
1677 type: bridge
1678 address: ${linux:network:host:public_local:address}
1679 netmask: 255.255.255.0
1680 use_interfaces:
1681 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001682 br-prv:
1683 enabled: true
1684 type: ovs_bridge
1685 mtu: 65000
1686 br-ens7:
1687 enabled: true
1688 name: br-ens7
1689 type: ovs_bridge
1690 proto: manual
1691 mtu: 9000
1692 use_interfaces:
1693 - ens7
1694 patch-br-ens7-br-prv:
1695 enabled: true
1696 name: ens7-prv
1697 ovs_type: ovs_port
1698 type: ovs_port
1699 bridge: br-ens7
1700 port_type: patch
1701 peer: prv-ens7
Oleksii Chupryn694ee722018-06-13 14:08:58 +03001702 tag: 109 # [] to unset a tag
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001703 mtu: 65000
1704 patch-br-prv-br-ens7:
1705 enabled: true
1706 name: prv-ens7
1707 bridge: br-prv
1708 ovs_type: ovs_port
1709 type: ovs_port
1710 port_type: patch
1711 peer: ens7-prv
Oleksii Chupryn694ee722018-06-13 14:08:58 +03001712 tag: 109
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001713 mtu: 65000
1714 ens7:
1715 enabled: true
1716 name: ens7
1717 proto: manual
1718 ovs_port_type: OVSPort
1719 type: ovs_port
1720 ovs_bridge: br-ens7
1721 bridge: br-ens7
Oleg Gelbukh36f01072019-07-01 15:26:16 -07001722 ens6:
1723 enabled: true
1724 proto: manual
1725 type: eth
1726 ovs_bridge: br-ctl
1727 br-ctl:
1728 enabled: true
1729 type: ovs_bridge
1730 internal-br-ctl-port:
1731 enabled: true
1732 proto: static
1733 address: 172.172.0.10
1734 netmask: 255.255.0.0
1735 name_servers:
1736 - 8.8.8.8
1737 - 172.172.172.172
1738 name: port-br-ctl
1739 bridge: br-ctl
1740 ovs_type: ovs_port
1741 type: ovs_port
1742 port_type: internal
1743 mtu: 65000
Filip Pytlounf5383a42015-10-06 16:28:32 +02001744
Petr Jediný8f8ae542017-07-13 16:19:12 +02001745Debian manual proto interfaces
1746
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001747When you are changing interface proto from static in up state
1748to manual, you may need to flush ip addresses. For example,
1749if you want to use the interface and the ip on the bridge.
1750This can be done by setting the ``ipflush_onchange`` to true.
Petr Jediný8f8ae542017-07-13 16:19:12 +02001751
1752.. code-block:: yaml
1753
1754 linux:
1755 network:
1756 interface:
1757 eth1:
1758 enabled: true
1759 type: eth
1760 proto: manual
1761 mtu: 9100
1762 ipflush_onchange: true
1763
Jiri Broulik1a191e32018-01-15 15:54:21 +01001764Debian static proto interfaces
1765
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001766When you are changing interface proto from dhcp in up state to
1767static, you may need to flush ip addresses and restart interface
1768to assign ip address from a managed file. For example, if you wantto
1769use the interface and the ip on the bridge. This can be done by
1770setting the ``ipflush_onchange`` with combination ``restart_on_ipflush``
1771param set to true.
Jiri Broulik1a191e32018-01-15 15:54:21 +01001772
1773.. code-block:: yaml
1774
1775 linux:
1776 network:
1777 interface:
1778 eth1:
1779 enabled: true
1780 type: eth
1781 proto: static
1782 address: 10.1.0.22
1783 netmask: 255.255.255.0
1784 ipflush_onchange: true
1785 restart_on_ipflush: true
Petr Jediný8f8ae542017-07-13 16:19:12 +02001786
Petr Jedinýd577cb52017-06-28 20:17:49 +02001787Concatinating and removing interface files
1788
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001789Debian based distributions have ``/etc/network/interfaces.d/``
1790directory, where you can store configuration of network
1791interfaces in separate files. You can concatinate the files
1792to the defined destination when needed, this operation removes
1793the file from the ``/etc/network/interfaces.d/``. If you just need
1794to remove iface files, you can use the ``remove_iface_files`` key.
Petr Jedinýd577cb52017-06-28 20:17:49 +02001795
1796.. code-block:: yaml
1797
1798 linux:
1799 network:
1800 concat_iface_files:
1801 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
1802 dst: '/etc/network/interfaces'
1803 remove_iface_files:
1804 - '/etc/network/interfaces.d/90-custom.cfg'
1805
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001806Configure DHCP client
Petr Jedinýd577cb52017-06-28 20:17:49 +02001807
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001808None of the keys is mandatory, include only those you really need.
1809For full list of available options under send, supersede, prepend,
1810append refer to dhcp-options(5).
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001811
1812.. code-block:: yaml
1813
1814 linux:
1815 network:
1816 dhclient:
1817 enabled: true
1818 backoff_cutoff: 15
1819 initial_interval: 10
1820 reboot: 10
1821 retry: 60
1822 select_timeout: 0
1823 timeout: 120
1824 send:
1825 - option: host-name
1826 declaration: "= gethostname()"
1827 supersede:
1828 - option: host-name
1829 declaration: "spaceship"
1830 - option: domain-name
1831 declaration: "domain.home"
1832 #- option: arp-cache-timeout
1833 # declaration: 20
1834 prepend:
1835 - option: domain-name-servers
1836 declaration:
1837 - 8.8.8.8
1838 - 8.8.4.4
1839 - option: domain-search
1840 declaration:
1841 - example.com
1842 - eng.example.com
1843 #append:
1844 #- option: domain-name-servers
1845 # declaration: 127.0.0.1
1846 # ip or subnet to reject dhcp offer from
1847 reject:
1848 - 192.33.137.209
1849 - 10.0.2.0/24
1850 request:
1851 - subnet-mask
1852 - broadcast-address
1853 - time-offset
1854 - routers
1855 - domain-name
1856 - domain-name-servers
1857 - domain-search
1858 - host-name
1859 - dhcp6.name-servers
1860 - dhcp6.domain-search
1861 - dhcp6.fqdn
1862 - dhcp6.sntp-servers
1863 - netbios-name-servers
1864 - netbios-scope
1865 - interface-mtu
1866 - rfc3442-classless-static-routes
1867 - ntp-servers
1868 require:
1869 - subnet-mask
1870 - domain-name-servers
1871 # if per interface configuration required add below
1872 interface:
1873 ens2:
1874 initial_interval: 11
1875 reject:
1876 - 192.33.137.210
1877 ens3:
1878 initial_interval: 12
1879 reject:
1880 - 192.33.137.211
1881
Petr Michaleceb14b552017-06-01 10:27:05 +02001882Linux network systemd settings:
1883
1884.. code-block:: yaml
1885
1886 linux:
1887 network:
1888 ...
1889 systemd:
1890 link:
1891 10-iface-dmz:
1892 Match:
1893 MACAddress: c8:5b:67:fa:1a:af
1894 OriginalName: eth0
1895 Link:
1896 Name: dmz0
1897 netdev:
1898 20-bridge-dmz:
1899 match:
1900 name: dmz0
1901 network:
1902 mescription: bridge
1903 bridge: br-dmz0
1904 network:
1905 # works with lowercase, keys are by default capitalized
1906 40-dhcp:
1907 match:
1908 name: '*'
1909 network:
1910 DHCP: yes
1911
Petr Michalec10462bb2017-03-23 19:18:08 +01001912Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001913
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001914Use ``/etc/environment`` for static system wide variable assignment
1915after boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001916
1917.. code-block:: yaml
1918
1919 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001920 system:
1921 env:
1922 BOB_VARIABLE: Alice
1923 ...
1924 BOB_PATH:
1925 - /srv/alice/bin
1926 - /srv/bob/bin
1927 ...
1928 ftp_proxy: none
1929 http_proxy: http://global-http-proxy.host.local:8080
1930 https_proxy: ${linux:system:proxy:https}
1931 no_proxy:
1932 - 192.168.0.80
1933 - 192.168.1.80
1934 - .domain.com
1935 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001936 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001937 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001938 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001939 ftp: ftp://proxy.host.local:2121
1940 http: http://proxy.host.local:3142
1941 https: https://proxy.host.local:3143
1942 noproxy:
1943 - .domain.com
1944 - .local
1945
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001946Configure the ``profile.d`` scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001947
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001948The ``profile.d`` scripts are being sourced during ``.sh`` execution
1949and support variable expansion in opposite to /etc/environment global
1950settings in ``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001951
1952.. code-block:: yaml
1953
1954 linux:
1955 system:
1956 profile:
1957 locales: |
1958 export LANG=C
1959 export LC_ALL=C
1960 ...
1961 vi_flavors.sh: |
1962 export PAGER=view
1963 export EDITOR=vim
1964 alias vi=vim
1965 shell_locales.sh: |
1966 export LANG=en_US
1967 export LC_ALL=en_US.UTF-8
1968 shell_proxies.sh: |
1969 export FTP_PROXY=ftp://127.0.3.3:2121
1970 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001971
Dmitry Teselkina0d31d12018-09-04 14:43:09 +03001972
1973Configure login.defs parameters
1974-------------------------------
1975
1976.. code-block:: yaml
1977
1978 linux:
1979 system:
1980 login_defs:
1981 <opt_name>:
1982 enabled: true
1983 value: <opt_value>
1984
1985<opt_name> is a configurational option defined in 'man login.defs'.
1986<opt_name> is case sensitive, should be UPPERCASE only!
1987
1988
Filip Pytlounf5383a42015-10-06 16:28:32 +02001989Linux with hosts
1990
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001991Parameter ``purge_hosts`` will enforce whole ``/etc/hosts file``,
1992removing entries that are not defined in model except defaults
1993for both IPv4 and IPv6 localhost and hostname as well as FQDN.
Ales Komarek417e8c52017-08-25 15:10:29 +02001994
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001995We recommend using this option to verify that ``/etc/hosts``
1996is always in a clean state. However it is not enabled by default
1997for security reasons.
Filip Pytloun86506fe2017-01-26 14:36:16 +01001998
Filip Pytlounf5383a42015-10-06 16:28:32 +02001999.. code-block:: yaml
2000
2001 linux:
2002 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01002003 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02002004 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01002005 # No need to define this one if purge_hosts is true
2006 hostname:
2007 address: 127.0.1.1
2008 names:
2009 - ${linux:network:fqdn}
2010 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02002011 node1:
2012 address: 192.168.10.200
2013 names:
2014 - node2.domain.com
2015 - service2.domain.com
2016 node2:
2017 address: 192.168.10.201
2018 names:
2019 - node2.domain.com
2020 - service2.domain.com
2021
Ales Komarek417e8c52017-08-25 15:10:29 +02002022Linux with hosts collected from mine
2023
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002024All DNS records defined within infrastrucuture
2025are passed to the local hosts records or any DNS server. Only
2026hosts with the ``grain`` parameter set to ``true`` will be propagated
2027to the mine.
Ales Komarek417e8c52017-08-25 15:10:29 +02002028
2029.. code-block:: yaml
2030
2031 linux:
2032 network:
2033 purge_hosts: true
2034 mine_dns_records: true
2035 host:
2036 node1:
2037 address: 192.168.10.200
2038 grain: true
2039 names:
2040 - node2.domain.com
2041 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01002042
Michael Polenchukc80ddd42019-01-15 18:47:48 +04002043Set up ``resolvconf's basic resolver info``, e.g. nameservers, search/domain and options:
Filip Pytlounde9bea52016-01-11 15:39:10 +01002044
2045.. code-block:: yaml
2046
2047 linux:
2048 network:
2049 resolv:
2050 dns:
Michael Polenchukc80ddd42019-01-15 18:47:48 +04002051 - 8.8.4.4
2052 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01002053 domain: my.example.com
2054 search:
Michael Polenchukc80ddd42019-01-15 18:47:48 +04002055 - my.example.com
2056 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01002057 options:
Michael Polenchukc80ddd42019-01-15 18:47:48 +04002058 - ndots:5
2059 - timeout:2
2060 - attempts:2
Filip Pytlounde9bea52016-01-11 15:39:10 +01002061
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002062Set up custom TX queue length for tap interfaces:
Andrii Petrenko735761d2017-03-21 17:17:35 -07002063
2064.. code-block:: yaml
2065
2066 linux:
2067 network:
2068 tap_custom_txqueuelen: 10000
2069
Michael Polenchukc37bd4a2019-04-22 15:20:03 +04002070Auto repair/re-attach libvirt's vnet interfaces:
2071
2072.. code-block:: yaml
2073
2074 linux:
2075 network:
2076 libvirt_vnet_repair: true
2077
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002078DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002079
2080**DPDK OVS NIC**
2081
2082.. code-block:: yaml
2083
2084 linux:
2085 network:
2086 bridge: openvswitch
2087 dpdk:
2088 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04002089 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002090 openvswitch:
2091 pmd_cpu_mask: "0x6"
2092 dpdk_socket_mem: "1024,1024"
2093 dpdk_lcore_mask: "0x400"
2094 memory_channels: 2
2095 interface:
2096 dpkd0:
2097 name: ${_param:dpdk_nic}
2098 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04002099 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002100 enabled: true
2101 type: dpdk_ovs_port
2102 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04002103 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002104 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01002105 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002106 br-prv:
2107 enabled: true
2108 type: dpdk_ovs_bridge
2109
2110**DPDK OVS Bond**
2111
2112.. code-block:: yaml
2113
2114 linux:
2115 network:
2116 bridge: openvswitch
2117 dpdk:
2118 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04002119 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002120 openvswitch:
2121 pmd_cpu_mask: "0x6"
2122 dpdk_socket_mem: "1024,1024"
2123 dpdk_lcore_mask: "0x400"
2124 memory_channels: 2
2125 interface:
2126 dpdk_second_nic:
2127 name: ${_param:primary_second_nic}
2128 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04002129 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002130 bond: dpdkbond0
2131 enabled: true
2132 type: dpdk_ovs_port
2133 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04002134 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01002135 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002136 dpdk_first_nic:
2137 name: ${_param:primary_first_nic}
2138 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04002139 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002140 bond: dpdkbond0
2141 enabled: true
2142 type: dpdk_ovs_port
2143 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04002144 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01002145 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002146 dpdkbond0:
2147 enabled: true
2148 bridge: br-prv
2149 type: dpdk_ovs_bond
2150 mode: active-backup
2151 br-prv:
2152 enabled: true
2153 type: dpdk_ovs_bridge
2154
Dzmitry Stremkouskif619b072018-03-15 20:13:42 +01002155**DPDK OVS LACP Bond with vlan tag**
2156
2157.. code-block:: yaml
2158
2159 linux:
2160 network:
2161 bridge: openvswitch
2162 dpdk:
2163 enabled: true
2164 driver: uio
2165 openvswitch:
2166 pmd_cpu_mask: "0x6"
2167 dpdk_socket_mem: "1024,1024"
2168 dpdk_lcore_mask: "0x400"
2169 memory_channels: "2"
2170 interface:
2171 eth3:
2172 enabled: true
2173 type: eth
2174 proto: manual
2175 name: ${_param:tenant_first_nic}
2176 eth4:
2177 enabled: true
2178 type: eth
2179 proto: manual
2180 name: ${_param:tenant_second_nic}
2181 dpdk0:
2182 name: ${_param:tenant_first_nic}
2183 pci: "0000:81:00.0"
2184 driver: igb_uio
2185 bond: bond1
2186 enabled: true
2187 type: dpdk_ovs_port
2188 n_rxq: 2
2189 dpdk1:
2190 name: ${_param:tenant_second_nic}
2191 pci: "0000:81:00.1"
2192 driver: igb_uio
2193 bond: bond1
2194 enabled: true
2195 type: dpdk_ovs_port
2196 n_rxq: 2
2197 bond1:
2198 enabled: true
2199 bridge: br-prv
2200 type: dpdk_ovs_bond
2201 mode: balance-slb
2202 br-prv:
2203 enabled: true
2204 type: dpdk_ovs_bridge
2205 tag: ${_param:tenant_vlan}
2206 address: ${_param:tenant_address}
2207 netmask: ${_param:tenant_network_netmask}
2208
Jakub Pavlikaa759062017-03-13 15:57:26 +01002209**DPDK OVS bridge for VXLAN**
2210
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002211If VXLAN is used as tenant segmentation, IP address must
2212be set on ``br-prv``.
Jakub Pavlikaa759062017-03-13 15:57:26 +01002213
2214.. code-block:: yaml
2215
2216 linux:
2217 network:
2218 ...
2219 interface:
2220 br-prv:
2221 enabled: true
2222 type: dpdk_ovs_bridge
2223 address: 192.168.50.0
2224 netmask: 255.255.255.0
Michael Polenchukd173d552018-01-22 15:22:47 +04002225 tag: 101
Jakub Pavlikaa759062017-03-13 15:57:26 +01002226 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002227
Oleksii Chupryne2151ff2018-03-13 16:01:12 +02002228**DPDK OVS bridge with Linux network interface**
2229
2230.. code-block:: yaml
2231
2232 linux:
2233 network:
2234 ...
2235 interface:
2236 eth0:
2237 type: eth
2238 ovs_bridge: br-prv
2239 ...
2240 br-prv:
2241 enabled: true
2242 type: dpdk_ovs_bridge
2243 ...
2244
Jakub Pavlik21ca2152017-02-27 22:21:09 +01002245Linux storage
2246-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02002247
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002248Linux with mounted Samba:
Filip Pytlounf5383a42015-10-06 16:28:32 +02002249
2250.. code-block:: yaml
2251
2252 linux:
2253 storage:
2254 enabled: true
2255 mount:
2256 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01002257 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02002258 - path: /media/myuser/public/
2259 - device: //192.168.0.1/storage
2260 - file_system: cifs
2261 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
2262
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002263NFS mount:
Jiri Broulikb017f932017-03-31 13:55:36 +02002264
2265.. code-block:: yaml
2266
2267 linux:
2268 storage:
2269 enabled: true
2270 mount:
2271 nfs_glance:
2272 enabled: true
2273 path: /var/lib/glance/images
2274 device: 172.16.10.110:/var/nfs/glance
2275 file_system: nfs
2276 opts: rw,sync
2277
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002278File swap configuration:
Filip Pytlounf5383a42015-10-06 16:28:32 +02002279
2280.. code-block:: yaml
2281
2282 linux:
2283 storage:
2284 enabled: true
2285 swap:
2286 file:
2287 enabled: true
2288 engine: file
2289 device: /swapfile
2290 size: 1024
2291
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002292Partition swap configuration:
Lachlan Evenson30676512016-01-22 15:43:28 -08002293
2294.. code-block:: yaml
2295
2296 linux:
2297 storage:
2298 enabled: true
2299 swap:
2300 partition:
2301 enabled: true
2302 engine: partition
2303 device: /dev/vg0/swap
2304
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002305LVM group ``vg1`` with one device and ``data`` volume mounted
2306into ``/mnt/data``.
Filip Pytlounc8a001a2015-12-15 14:09:19 +01002307
2308.. code-block:: yaml
2309
2310 parameters:
2311 linux:
2312 storage:
2313 mount:
2314 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01002315 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01002316 device: /dev/vg1/data
2317 file_system: ext4
2318 path: /mnt/data
2319 lvm:
2320 vg1:
2321 enabled: true
2322 devices:
2323 - /dev/sdb
2324 volume:
2325 data:
2326 size: 40G
2327 mount: ${linux:storage:mount:data}
root3387f332019-01-11 08:55:32 +00002328 # When set they will take precedence over filters aget from volume groups.
2329 lvm_filters:
2330 10:
2331 enabled: True
2332 value: "a|loop|"
2333 20:
2334 enabled: True
2335 value: "r|/dev/hdc|"
2336 30:
2337 enabled: True
2338 value: "a|/dev/ide|"
2339 40:
2340 enabled: True
2341 value: "r|.*|"
Filip Pytlounc8a001a2015-12-15 14:09:19 +01002342
Jakub Pavlik4f742142017-08-08 15:05:50 +02002343Create partitions on disk. Specify size in MB. It expects empty
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002344disk without any existing partitions.
2345Set ``startsector=1`` if you want to start partitions from ``2048``.
Jakub Pavlik4f742142017-08-08 15:05:50 +02002346
2347.. code-block:: yaml
2348
2349 linux:
2350 storage:
2351 disk:
2352 first_drive:
Piotr Krukd51911b2017-12-04 11:27:08 +01002353 startsector: 1
Jakub Pavlik4f742142017-08-08 15:05:50 +02002354 name: /dev/loop1
2355 type: gpt
2356 partitions:
2357 - size: 200 #size in MB
2358 type: fat32
2359 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02002360 mkfs: True
2361 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02002362 /dev/vda1:
2363 partitions:
2364 - size: 5
2365 type: ext2
2366 - size: 10
2367 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02002368
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002369Multipath with Fujitsu Eternus DXL:
Ales Komareka634f4b2016-10-02 13:11:04 +02002370
2371.. code-block:: yaml
2372
2373 parameters:
2374 linux:
2375 storage:
2376 multipath:
2377 enabled: true
2378 blacklist_devices:
2379 - /dev/sda
2380 - /dev/sdb
2381 backends:
2382 - fujitsu_eternus_dxl
2383
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002384Multipath with Hitachi VSP 1000:
Ales Komareka634f4b2016-10-02 13:11:04 +02002385
2386.. code-block:: yaml
2387
2388 parameters:
2389 linux:
2390 storage:
2391 multipath:
2392 enabled: true
2393 blacklist_devices:
2394 - /dev/sda
2395 - /dev/sdb
2396 backends:
2397 - hitachi_vsp1000
2398
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002399Multipath with IBM Storwize:
Ales Komareka634f4b2016-10-02 13:11:04 +02002400
2401.. code-block:: yaml
2402
2403 parameters:
2404 linux:
2405 storage:
2406 multipath:
2407 enabled: true
2408 blacklist_devices:
2409 - /dev/sda
2410 - /dev/sdb
2411 backends:
2412 - ibm_storwize
2413
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002414Multipath with multiple backends:
Ales Komareka634f4b2016-10-02 13:11:04 +02002415
2416.. code-block:: yaml
2417
2418 parameters:
2419 linux:
2420 storage:
2421 multipath:
2422 enabled: true
2423 blacklist_devices:
2424 - /dev/sda
2425 - /dev/sdb
2426 - /dev/sdc
2427 - /dev/sdd
2428 backends:
2429 - ibm_storwize
2430 - fujitsu_eternus_dxl
2431 - hitachi_vsp1000
2432
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002433PAM LDAP integration:
Dmitry Stremkouski7d8d67a2017-11-15 13:08:19 +03002434
2435.. code-block:: yaml
2436
2437 parameters:
2438 linux:
2439 system:
2440 auth:
2441 enabled: true
Dzmitry Stremkouski602735d2018-05-09 22:31:39 +02002442 mkhomedir:
2443 enabled: true
2444 umask: 0027
Dmitry Stremkouski7d8d67a2017-11-15 13:08:19 +03002445 ldap:
2446 enabled: true
2447 binddn: cn=bind,ou=service_users,dc=example,dc=com
2448 bindpw: secret
2449 uri: ldap://127.0.0.1
2450 base: ou=users,dc=example,dc=com
2451 ldap_version: 3
2452 pagesize: 65536
2453 referrals: off
2454 filter:
2455 passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
2456 shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
2457 group: (&(objectClass=group)(gidNumber=*))
2458
Gleb Galkin93b9ae92018-10-18 13:57:30 +03002459PAM duo 2FA integration
2460
2461.. code-block:: yaml
2462
2463 parameters:
2464 linux:
2465 system:
2466 auth:
2467 enabled: true
2468 duo:
2469 enabled: true
2470 duo_host: localhost
2471 duo_ikey: DUO-INTEGRATION-KEY
2472 duo_skey: DUO-SECRET-KEY
2473
2474duo package version may be specified (optional)
2475
2476.. code-block:: yaml
2477
2478 linux:
2479 system:
2480 package:
2481 duo-unix:
2482 version: 1.10.1-0
2483
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002484Disabled multipath (the default setup):
Ales Komareka634f4b2016-10-02 13:11:04 +02002485
2486.. code-block:: yaml
2487
2488 parameters:
2489 linux:
2490 storage:
2491 multipath:
2492 enabled: false
2493
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002494Linux with local loopback device:
Simon Pasquier375001e2017-01-26 13:22:33 +01002495
2496.. code-block:: yaml
2497
2498 linux:
2499 storage:
2500 loopback:
2501 disk1:
2502 file: /srv/disk1
2503 size: 50G
2504
Filip Pytlounb2c8f852016-11-21 17:03:43 +01002505External config generation
2506--------------------------
2507
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002508You are able to use config support metadata between formulas
2509and only generate configuration files for external use, for example, Docker, and so on.
Filip Pytlounb2c8f852016-11-21 17:03:43 +01002510
2511.. code-block:: yaml
2512
2513 parameters:
2514 linux:
2515 system:
2516 config:
2517 pillar:
2518 jenkins:
2519 master:
2520 home: /srv/volumes/jenkins
2521 approved_scripts:
2522 - method java.net.URL openConnection
2523 credentials:
2524 - type: username_password
2525 scope: global
2526 id: test
2527 desc: Testing credentials
2528 username: test
2529 password: test
2530
Vladimir Ereminccf28842017-04-10 23:52:10 +03002531Netconsole Remote Kernel Logging
2532--------------------------------
2533
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002534Netconsole logger can be configured for the configfs-enabled kernels
2535(``CONFIG_NETCONSOLE_DYNAMIC`` must be enabled). The configuration
2536applies both in runtime (if network is already configured),
2537and on-boot after an interface initialization.
Vladimir Ereminccf28842017-04-10 23:52:10 +03002538
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002539.. note::
2540
2541 * Receiver can be located only on the same L3 domain
2542 (or you need to configure gateway MAC manually).
2543 * The Receiver MAC is detected only on configuration time.
2544 * Using broadcast MAC is not recommended.
Vladimir Ereminccf28842017-04-10 23:52:10 +03002545
2546.. code-block:: yaml
2547
2548 parameters:
2549 linux:
2550 system:
2551 netconsole:
2552 enabled: true
2553 port: 514 (optional)
2554 loglevel: debug (optional)
2555 target:
2556 192.168.0.1:
2557 interface: bond0
2558 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02002559
Dzmitry Stremkouskid1a268b2018-10-03 16:36:04 +02002560Check network params on the environment
2561---------------------------------------
2562
2563Grab nics and nics states
2564
2565.. code-block:: bash
2566
2567 salt osd001\* net_checks.get_nics
2568
2569**Example of system output:**
2570
2571.. code-block:: bash
2572
2573 osd001.domain.com:
2574 |_
2575 - bond0
2576 - None
2577 - 1e:c8:64:42:23:b9
2578 - 0
2579 - 1500
2580 |_
2581 - bond1
2582 - None
2583 - 3c:fd:fe:27:3b:00
2584 - 1
2585 - 9100
2586 |_
2587 - fourty1
2588 - None
2589 - 3c:fd:fe:27:3b:00
2590 - 1
2591 - 9100
2592 |_
2593 - fourty2
2594 - None
2595 - 3c:fd:fe:27:3b:02
2596 - 1
2597 - 9100
2598
2599Grab 10G nics PCI addresses for hugepages setup
2600
2601.. code-block:: bash
2602
2603 salt cmp001\* net_checks.get_ten_pci
2604
2605**Example of system output:**
2606
2607.. code-block:: bash
2608
2609 cmp001.domain.com:
2610 |_
2611 - ten1
2612 - 0000:19:00.0
2613 |_
2614 - ten2
2615 - 0000:19:00.1
2616 |_
2617 - ten3
2618 - 0000:19:00.2
2619 |_
2620 - ten4
2621 - 0000:19:00.3
2622
2623Grab ip address for an interface
2624
2625.. code-block:: bash
2626
2627 salt cmp001\* net_checks.get_ip iface=one4
2628
2629**Example of system output:**
2630
2631.. code-block:: bash
2632
2633 cmp001.domain.com:
2634 10.200.177.101
2635
2636Grab ip addresses map
2637
2638.. code-block:: bash
2639
2640 salt-call net_checks.nodes_addresses
2641
2642**Example of system output:**
2643
2644.. code-block:: bash
2645
2646 local:
2647 |_
2648 - cid01.domain.com
2649 |_
2650 |_
2651 - pxe
2652 - 10.200.177.91
2653 |_
2654 - control
2655 - 10.200.178.91
2656 |_
2657 - cmn02.domain.com
2658 |_
2659 |_
2660 - storage_access
2661 - 10.200.181.67
2662 |_
2663 - pxe
2664 - 10.200.177.67
2665 |_
2666 - control
2667 - 10.200.178.67
2668 |_
2669 - cmp010.domain.com
2670 |_
2671 |_
2672 - pxe
2673 - 10.200.177.110
2674 |_
2675 - storage_access
2676 - 10.200.181.110
2677 |_
2678 - control
2679 - 10.200.178.110
2680 |_
2681 - vxlan
2682 - 10.200.179.110
2683
2684Verify full mesh connectivity
2685
2686.. code-block:: bash
2687
2688 salt-call net_checks.ping_check
2689
2690**Example of positive system output:**
2691
2692.. code-block:: bash
2693
2694 ['PASSED']
2695 [INFO ] ['PASSED']
2696 local:
2697 True
2698
2699**Example of system output in case of failure:**
2700
2701.. code-block:: bash
2702
2703 FAILED
2704 [ERROR ] FAILED
2705 ['control: 10.0.1.92 -> 10.0.1.224: Failed']
2706 ['control: 10.0.1.93 -> 10.0.1.224: Failed']
2707 ['control: 10.0.1.51 -> 10.0.1.224: Failed']
2708 ['control: 10.0.1.102 -> 10.0.1.224: Failed']
2709 ['control: 10.0.1.13 -> 10.0.1.224: Failed']
2710 ['control: 10.0.1.81 -> 10.0.1.224: Failed']
2711 local:
2712 False
2713
2714For this feature to work, please mark addresses with some role.
2715Otherwise 'default' role is assumed and mesh would consist of all
2716addresses on the environment.
2717
2718Mesh mark is needed only for interfaces which are enabled and have
2719ip address assigned.
2720
2721Checking dhcp pxe network meaningless, as it is used for salt
2722master vs minion communications, therefore treated as checked.
2723
2724.. code-block:: yaml
2725
2726 parameters:
2727 linux:
2728 network:
2729 interface:
2730 ens3:
2731 enabled: true
2732 type: eth
2733 proto: static
2734 address: ${_param:deploy_address}
2735 netmask: ${_param:deploy_network_netmask}
2736 gateway: ${_param:deploy_network_gateway}
2737 mesh: pxe
2738
2739Check pillars for ip address duplicates
2740
2741.. code-block:: bash
2742
2743 salt-call net_checks.verify_addresses
2744
2745**Example of positive system output:**
2746
2747.. code-block:: bash
2748
2749 ['PASSED']
2750 [INFO ] ['PASSED']
2751 local:
2752 True
2753
2754**Example of system output in case of failure:**
2755
2756.. code-block:: bash
2757
2758 FAILED. Duplicates found
2759 [ERROR ] FAILED. Duplicates found
2760 ['gtw01.domain.com', 'gtw02.domain.com', '10.0.1.224']
2761 [ERROR ] ['gtw01.domain.com', 'gtw02.domain.com', '10.0.1.224']
2762 local:
2763 False
2764
2765Generate csv report for the env
2766
2767.. code-block:: bash
2768
2769 salt -C 'kvm* or cmp* or osd*' net_checks.get_nics_csv \
2770 | grep '^\ ' | sed 's/\ *//g' | grep -Ev ^server \
2771 | sed '1 i\server,nic_name,ip_addr,mac_addr,link,mtu,chassis_id,chassis_name,port_mac,port_descr'
2772
2773**Example of system output:**
2774
2775.. code-block:: bash
2776
2777 server,nic_name,ip_addr,mac_addr,link,mtu,chassis_id,chassis_name,port_mac,port_descr
2778 cmp010.domain.com,bond0,None,b4:96:91:10:5b:3a,1,1500,,,,
2779 cmp010.domain.com,bond0.21,10.200.178.110,b4:96:91:10:5b:3a,1,1500,,,,
2780 cmp010.domain.com,bond0.22,10.200.179.110,b4:96:91:10:5b:3a,1,1500,,,,
2781 cmp010.domain.com,bond1,None,3c:fd:fe:34:ad:22,0,1500,,,,
2782 cmp010.domain.com,bond1.24,10.200.181.110,3c:fd:fe:34:ad:22,0,1500,,,,
2783 cmp010.domain.com,fourty5,None,3c:fd:fe:34:ad:20,0,9000,,,,
2784 cmp010.domain.com,fourty6,None,3c:fd:fe:34:ad:22,0,9000,,,,
2785 cmp010.domain.com,one1,None,b4:96:91:10:5b:38,0,1500,,,,
2786 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
2787 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
2788 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
2789 cmp011.domain.com,bond0,None,b4:96:91:13:6c:aa,1,1500,,,,
2790 cmp011.domain.com,bond0.21,10.200.178.111,b4:96:91:13:6c:aa,1,1500,,,,
2791 cmp011.domain.com,bond0.22,10.200.179.111,b4:96:91:13:6c:aa,1,1500,,,,
2792 ...
2793
Filip Pytlounf5383a42015-10-06 16:28:32 +02002794Usage
2795=====
2796
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002797Set MTU of the eth0 network interface to 1400:
Filip Pytlounf5383a42015-10-06 16:28:32 +02002798
2799.. code-block:: bash
2800
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002801 ip link set dev eth0 mtu 1400
Filip Pytlounf5383a42015-10-06 16:28:32 +02002802
Denis Egorenko2e6ad0f2019-10-02 14:57:10 +04002803Switch Kernel from non-HWE to HWE
2804==================================
2805
2806It is possible to switch Kernel from non-HWE to HWE by using module
2807linux_kernel_switch. It has few methods:
2808
2809* check_hwe_kernel
2810* switch_kernel
2811* rollback_switch_kernel
2812
2813Method ``check_hwe_kernel`` allows to check whether HWE kernel installed
2814or not:
2815
2816.. code-block:: bash
2817
2818 salt <target> linux_kernel_switch.check_hwe_kernel
2819
2820Output for case HWE is installed:
2821
2822.. code-bloc:: bash
2823
2824 kvm02.cluster-env.local:
2825 ----------
2826 linux-image-extra-virtual-hwe-16.04:
2827 ----------
2828 linux-image-extra-virtual-hwe-16.04:
2829 ----------
2830 architecture:
2831 amd64
2832 description:
2833 Extra drivers for Virtual Linux kernel image
2834 This package will always depend on linux-image-generic.
2835 group:
2836 kernel
2837 install_date:
2838 2019-10-01T11:50:15Z
2839 name:
2840 linux-image-extra-virtual-hwe-16.04
2841 packager:
2842 Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
2843 source:
2844 linux-meta-hwe
2845 version:
2846 4.15.0.54.75
2847 ...
2848
2849Output for case HWE is not installed:
2850
2851.. code-bloc:: bash
2852
2853 kvm02.cluster-env.local:
2854 ----------
2855 linux-image-extra-virtual-hwe-16.04:
2856 Not installed!
2857 linux-image-generic-hwe-16.04:
2858 Not installed!
2859
2860Method ``switch_kernel`` allows you to switch from non-HWE to HWE. It has
2861two options: ``dry_run`` - to check what packages are going to be installed or
2862removed and ``only_kernel`` - install only Kernel image packages without other
2863HWE packages.
2864
2865Method ``rollback_switch_kernel`` allows you to rollback method
2866``switch_kernel`` which was executed successfully previously. Option
2867``dry_run`` - to check what packages are going to be installed/removed.
2868
Filip Pytlounf5383a42015-10-06 16:28:32 +02002869Read more
2870=========
2871
2872* https://www.archlinux.org/
2873* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu