blob: 598b638967b972fe9ffd6fc9c4d5e018fe7f7791 [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'
53 jsmith:
54 name: 'jsmith'
55 enabled: true
azvyagintsev967af132017-06-12 12:25:24 +030056 full_name: 'With clear password'
Filip Pytlounf5383a42015-10-06 16:28:32 +020057 home: '/home/jsmith'
azvyagintsev967af132017-06-12 12:25:24 +030058 hash_password: true
59 password: "userpassword"
60 mark:
61 name: 'mark'
62 enabled: true
63 full_name: "unchange password'
64 home: '/home/mark'
65 password: false
66 elizabeth:
67 name: 'elizabeth'
68 enabled: true
69 full_name: 'With hased password'
70 home: '/home/elizabeth'
71 password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10"
Filip Pytlounf5383a42015-10-06 16:28:32 +020072
Petr Michalec1c4c8d82017-02-28 19:09:21 +010073Configure sudo for users and groups under ``/etc/sudoers.d/``.
74This ways ``linux.system.sudo`` pillar map to actual sudo attributes:
75
76.. code-block:: jinja
Aleš Komárek63572992017-04-11 13:16:44 +020077
Petr Michalec1c4c8d82017-02-28 19:09:21 +010078 # simplified template:
79 Cmds_Alias {{ alias }}={{ commands }}
80 {{ user }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
81 %{{ group }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
82
83 # when rendered:
84 saltuser1 ALL=(ALL) NOPASSWD: ALL
85
Petr Michalec1c4c8d82017-02-28 19:09:21 +010086.. code-block:: yaml
Aleš Komárek63572992017-04-11 13:16:44 +020087
Petr Michalec1c4c8d82017-02-28 19:09:21 +010088 linux:
89 system:
90 sudo:
91 enabled: true
Tomas Kammd8eb3002017-05-08 19:30:29 +020092 aliases:
Petr Michalec1c4c8d82017-02-28 19:09:21 +010093 host:
94 LOCAL:
95 - localhost
96 PRODUCTION:
97 - db1
98 - db2
99 runas:
100 DBA:
101 - postgres
102 - mysql
103 SALT:
104 - root
105 command:
106 # Note: This is not 100% safe when ALL keyword is used, user still may modify configs and hide his actions.
107 # Best practice is to specify full list of commands user is allowed to run.
108 SUPPORT_RESTRICTED:
109 - /bin/vi /etc/sudoers*
110 - /bin/vim /etc/sudoers*
111 - /bin/nano /etc/sudoers*
112 - /bin/emacs /etc/sudoers*
113 - /bin/su - root
114 - /bin/su -
115 - /bin/su
116 - /usr/sbin/visudo
117 SUPPORT_SHELLS:
118 - /bin/sh
119 - /bin/ksh
120 - /bin/bash
121 - /bin/rbash
122 - /bin/dash
123 - /bin/zsh
124 - /bin/csh
125 - /bin/fish
126 - /bin/tcsh
127 - /usr/bin/login
128 - /usr/bin/su
129 - /usr/su
130 ALL_SALT_SAFE:
131 - /usr/bin/salt state*
132 - /usr/bin/salt service*
133 - /usr/bin/salt pillar*
134 - /usr/bin/salt grains*
135 - /usr/bin/salt saltutil*
136 - /usr/bin/salt-call state*
137 - /usr/bin/salt-call service*
138 - /usr/bin/salt-call pillar*
139 - /usr/bin/salt-call grains*
140 - /usr/bin/salt-call saltutil*
141 SALT_TRUSTED:
142 - /usr/bin/salt*
143 users:
144 # saltuser1 with default values: saltuser1 ALL=(ALL) NOPASSWD: ALL
145 saltuser1: {}
146 saltuser2:
147 hosts:
148 - LOCAL
149 # User Alias DBA
150 DBA:
151 hosts:
152 - ALL
153 commands:
154 - ALL_SALT_SAFE
155 groups:
156 db-ops:
157 hosts:
158 - ALL
159 - '!PRODUCTION'
160 runas:
161 - DBA
162 commands:
163 - /bin/cat *
164 - /bin/less *
165 - /bin/ls *
166 salt-ops:
167 hosts:
168 - 'ALL'
169 runas:
170 - SALT
171 commands:
172 - SUPPORT_SHELLS
173 salt-ops-2nd:
174 name: salt-ops
175 nopasswd: false
Jakub Josef7a9d9b92017-05-16 11:39:01 +0200176 setenv: true # Enable sudo -E option
Petr Michalec1c4c8d82017-02-28 19:09:21 +0100177 runas:
178 - DBA
179 commands:
180 - ALL
181 - '!SUPPORT_SHELLS'
182 - '!SUPPORT_RESTRICTED'
183
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300184Linux with package, latest version:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200185
186.. code-block:: yaml
187
188 linux:
189 system:
190 ...
191 package:
192 package-name:
193 version: latest
194
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300195Linux with package from certail repo, version with no upgrades:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200196
197.. code-block:: yaml
198
199 linux:
200 system:
201 ...
202 package:
203 package-name:
204 version: 2132.323
205 repo: 'custom-repo'
206 hold: true
207
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300208Linux with package from certail repo, version with no GPG
209verification:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200210
211.. code-block:: yaml
212
213 linux:
214 system:
215 ...
216 package:
217 package-name:
218 version: 2132.323
219 repo: 'custom-repo'
220 verify: false
221
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300222Linux with autoupdates (automatically install security package
223updates):
Bruno Binet69a9d8d2017-02-16 22:34:32 +0100224
225.. code-block:: yaml
226
227 linux:
228 system:
229 ...
230 autoupdates:
231 enabled: true
232 mail: root@localhost
233 mail_only_on_error: true
234 remove_unused_dependencies: false
235 automatic_reboot: true
236 automatic_reboot_time: "02:00"
237
Dmitry Teselkin0f084a02018-08-29 14:46:38 +0300238Managing cron tasks
239-------------------
240
241There are two data structures that are related to managing cron itself and
242cron tasks:
243
244.. code-block:: yaml
245
246 linux:
247 system:
248 cron:
249
250and
251
252.. code-block:: yaml
253
254 linux:
255 system:
256 job:
257
258`linux:system:cron` manages cron packages, services, and '/etc/cron.allow' file.
259
260'deny' files are managed the only way - we're ensuring they are absent, that's
261a requirement from CIS 5.1.8
262
263'cron' pillar structure is the following:
264
265.. code-block:: yaml
266
267 linux:
268 system:
269 cron:
270 enabled: true
271 pkgs: [ <cron packages> ]
272 services: [ <cron services> ]
273 user:
274 <username>:
275 enabled: true
276
277To add user to '/etc/cron.allow' use 'enabled' key as shown above.
278
279'/etc/cron.deny' is not managed as CIS 5.1.8 requires it was removed.
280
281A user would be ignored if any of the following is true:
282* user is disabled in `linux:system:user:<username>`
283* user is disabled in `linux:system:cron:user:<username>`
284
285`linux:system:job` manages individual cron tasks.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300286
287By default, it will use name as an identifier, unless identifier key is
Filip Pytloun91222222017-08-04 10:55:27 +0200288explicitly set or False (then it will use Salt's default behavior which is
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300289identifier same as command resulting in not being able to change it):
Filip Pytlounf5383a42015-10-06 16:28:32 +0200290
291.. code-block:: yaml
292
293 linux:
294 system:
295 ...
296 job:
297 cmd1:
298 command: '/cmd/to/run'
Filip Pytloun91222222017-08-04 10:55:27 +0200299 identifier: cmd1
Filip Pytlounf5383a42015-10-06 16:28:32 +0200300 enabled: true
301 user: 'root'
302 hour: 2
303 minute: 0
304
Dmitry Teselkin0f084a02018-08-29 14:46:38 +0300305Managing 'at' tasks
306-------------------
307
308Pillar for managing `at` tasks is similar to one for `cron` tasks:
309
310.. code-block:: yaml
311
312 linux:
313 system:
314 at:
315 enabled: true
316 pkgs: [ <at packages> ]
317 services: [ <at services> ]
318 user:
319 <username>:
320 enabled: true
321
322To add a user to '/etc/at.allow' use 'enabled' key as shown above.
323
324'/etc/at.deny' is not managed as CIS 5.1.8 requires it was removed.
325
326A user will be ignored if any of the following is true:
327* user is disabled in `linux:system:user:<username>`
328* user is disabled in `linux:system:at:user:<username>`
329
330
Filip Pytlound0a29e72015-11-30 15:23:34 +0100331Linux security limits (limit sensu user memory usage to max 1GB):
332
333.. code-block:: yaml
334
335 linux:
336 system:
337 ...
338 limit:
339 sensu:
340 enabled: true
341 domain: sensu
342 limits:
343 - type: hard
344 item: as
345 value: 1000000
346
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300347Enable autologin on ``tty1`` (may work only for Ubuntu 14.04):
Filip Pytloun7fee0542015-10-15 11:19:24 +0200348
349.. code-block:: yaml
350
351 linux:
352 system:
353 console:
354 tty1:
355 autologin: root
Filip Pytloun281d0202016-01-29 14:03:51 +0100356 # Enable serial console
357 ttyS0:
358 autologin: root
359 rate: 115200
360 term: xterm
Filip Pytloun7fee0542015-10-15 11:19:24 +0200361
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300362To disable set autologin to ``false``.
Filip Pytloun7fee0542015-10-15 11:19:24 +0200363
Filip Pytloun7731b852016-02-01 11:13:47 +0100364Set ``policy-rc.d`` on Debian-based systems. Action can be any available
365command in ``while true`` loop and ``case`` context.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300366Following will disallow dpkg to stop/start services for the Cassandra
367package automatically:
Filip Pytloun7731b852016-02-01 11:13:47 +0100368
369.. code-block:: yaml
370
371 linux:
372 system:
373 policyrcd:
374 - package: cassandra
375 action: exit 101
376 - package: '*'
377 action: switch
378
Filip Pytlounc49445a2016-04-04 14:23:20 +0200379Set system locales:
380
381.. code-block:: yaml
382
383 linux:
384 system:
385 locale:
386 en_US.UTF-8:
387 default: true
Filip Pytlounee1745f2016-04-04 17:39:41 +0200388 "cs_CZ.UTF-8 UTF-8":
Filip Pytlounc49445a2016-04-04 14:23:20 +0200389 enabled: true
390
Andrey Shestakove7cca052017-05-24 23:06:24 +0300391Systemd settings:
392
393.. code-block:: yaml
394
395 linux:
396 system:
397 ...
398 systemd:
399 system:
400 Manager:
401 DefaultLimitNOFILE: 307200
402 DefaultLimitNPROC: 307200
403 user:
404 Manager:
405 DefaultLimitCPU: 2
406 DefaultLimitNPROC: 4
407
Filip Pytloun8b2131e2017-11-08 13:29:03 +0100408Ensure presence of directory:
409
410.. code-block:: yaml
411
412 linux:
413 system:
414 directory:
415 /tmp/test:
416 user: root
417 group: root
418 mode: 700
419 makedirs: true
420
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300421Ensure presence of file by specifying its source:
Richard Felkl2e07d652018-01-19 10:19:06 +0100422
423.. code-block:: yaml
424
425 linux:
426 system:
427 file:
428 /tmp/test.txt:
429 source: http://example.com/test.txt
Richard Felklf40599a2018-02-06 22:56:41 +0100430 user: root #optional
431 group: root #optional
432 mode: 700 #optional
433 dir_mode: 700 #optional
434 encoding: utf-8 #optional
435 hash: <<hash>> or <<URI to hash>> #optional
436 makedirs: true #optional
437
438 linux:
439 system:
440 file:
441 test.txt:
442 name: /tmp/test.txt
443 source: http://example.com/test.txt
Richard Felkl2e07d652018-01-19 10:19:06 +0100444
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300445Ensure presence of file by specifying its contents:
Richard Felkl2e07d652018-01-19 10:19:06 +0100446
447.. code-block:: yaml
448
449 linux:
450 system:
451 file:
452 /tmp/test.txt:
453 contents: |
454 line1
455 line2
Richard Felklf40599a2018-02-06 22:56:41 +0100456
457 linux:
458 system:
459 file:
460 /tmp/test.txt:
461 contents_pillar: linux:network:hostname
462
463 linux:
464 system:
465 file:
466 /tmp/test.txt:
467 contents_grains: motd
468
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300469Ensure presence of file to be serialized through one of the
470serializer modules (see:
471https://docs.saltstack.com/en/latest/ref/serializers/all/index.html):
Bruno Binet9c2fe222018-06-08 16:57:32 +0200472
473.. code-block:: yaml
474
475 linux:
476 system:
477 file:
478 /tmp/test.json:
479 serialize: json
480 contents:
481 foo: 1
482 bar: 'bar'
483
Filip Pytloun281034a2016-01-04 18:06:22 +0100484Kernel
485~~~~~~
486
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300487Install always up to date LTS kernel and headers from Ubuntu Trusty:
Filip Pytloun281034a2016-01-04 18:06:22 +0100488
489.. code-block:: yaml
490
491 linux:
492 system:
493 kernel:
494 type: generic
495 lts: trusty
496 headers: true
497
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300498Load kernel modules and add them to ``/etc/modules``:
Tomáš Kukrálba35b212017-02-15 17:59:46 +0100499
500.. code-block:: yaml
501
502 linux:
503 system:
504 kernel:
505 modules:
506 - nf_conntrack
507 - tp_smapi
508 - 8021q
509
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300510Configure or blacklist kernel modules with additional options to
511``/etc/modprobe.d`` following example will add
512``/etc/modprobe.d/nf_conntrack.conf`` file with line
513``options nf_conntrack hashsize=262144``:
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300514
Dmitry Teselkin809834c2018-08-13 19:14:42 +0300515'option' can be a mapping (with 'enabled' and 'value' keys) or a scalar.
516
517Example for 'scalar' option value:
518
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300519.. code-block:: yaml
520
521 linux:
522 system:
523 kernel:
524 module:
525 nf_conntrack:
526 option:
527 hashsize: 262144
528
Dmitry Teselkin809834c2018-08-13 19:14:42 +0300529Example for 'mapping' option value:
530
531.. code-block:: yaml
532
533 linux:
534 system:
535 kernel:
536 module:
537 nf_conntrack:
538 option:
539 hashsize:
540 enabled: true
541 value: 262144
542
543NOTE: 'enabled' key is optional and is True by default.
544
545Blacklist a module:
546
547.. code-block:: yaml
548
549 linux:
550 system:
551 kernel:
552 module:
553 nf_conntrack:
554 blacklist: true
555
556A module can have a number of aliases, wildcards are allowed.
557Define an alias for a module:
558
559.. code-block:: yaml
560
561 linux:
562 system:
563 kernel:
564 module:
565 nf_conntrack:
566 alias:
567 nfct:
568 enabled: true
569 "nf_conn*":
570 enabled: true
571
572NOTE: 'enabled' key is mandatory as there are no other keys exist.
573
574Execute custom command instead of 'insmod' when inserting a module:
575
576.. code-block:: yaml
577
578 linux:
579 system:
580 kernel:
581 module:
582 nf_conntrack:
583 install:
584 enabled: true
585 command: /bin/true
586
587NOTE: 'enabled' key is optional and is True by default.
588
589Execute custom command instead of 'rmmod' when removing a module:
590
591.. code-block:: yaml
592
593 linux:
594 system:
595 kernel:
596 module:
597 nf_conntrack:
598 remove:
599 enabled: true
600 command: /bin/true
601
602NOTE: 'enabled' key is optional and is True by default.
603
604Define module dependencies:
605
606.. code-block:: yaml
607
608 linux:
609 system:
610 kernel:
611 module:
612 nf_conntrack:
613 softdep:
614 pre:
615 1:
616 enabled: true
617 value: a
618 2:
619 enabled: true
620 value: b
621 3:
622 enabled: true
623 value: c
624 post:
625 1:
626 enabled: true
627 value: x
628 2:
629 enabled: true
630 value: y
631 3:
632 enabled: true
633 value: z
634
635NOTE: 'enabled' key is optional and is True by default.
636
637
Filip Pytloun281034a2016-01-04 18:06:22 +0100638Install specific kernel version and ensure all other kernel packages are
639not present. Also install extra modules and headers for this kernel:
640
641.. code-block:: yaml
642
643 linux:
644 system:
645 kernel:
646 type: generic
647 extra: true
648 headers: true
649 version: 4.2.0-22
650
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300651Systcl kernel parameters:
Jakub Pavlik32c2cb02016-01-29 12:45:29 +0100652
653.. code-block:: yaml
654
655 linux:
656 system:
657 kernel:
658 sysctl:
659 net.ipv4.tcp_keepalive_intvl: 3
660 net.ipv4.tcp_keepalive_time: 30
661 net.ipv4.tcp_keepalive_probes: 8
662
Michael Polenchukebf55522018-01-25 13:22:39 +0400663Configure kernel boot options:
664
665.. code-block:: yaml
666
667 linux:
668 system:
669 kernel:
670 boot_options:
671 - elevator=deadline
672 - spectre_v2=off
673 - nopti
674
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100675CPU
676~~~
677
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300678Enable cpufreq governor for every cpu:
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100679
680.. code-block:: yaml
681
682 linux:
683 system:
684 cpu:
685 governor: performance
686
Nick Metzf04f5f32018-01-08 15:25:04 +0100687
Jiri Broulik303905d2018-01-11 14:12:48 +0100688CGROUPS
689~~~~~~~
690
691Setup linux cgroups:
692
693.. code-block:: yaml
694
695 linux:
696 system:
697 cgroup:
698 enabled: true
699 group:
700 ceph_group_1:
701 controller:
702 cpu:
703 shares:
704 value: 250
705 cpuacct:
706 usage:
707 value: 0
708 cpuset:
709 cpus:
710 value: 1,2,3
711 memory:
712 limit_in_bytes:
713 value: 2G
714 memsw.limit_in_bytes:
715 value: 3G
716 mapping:
717 subjects:
718 - '@ceph'
719 generic_group_1:
720 controller:
721 cpu:
722 shares:
723 value: 250
724 cpuacct:
725 usage:
726 value: 0
727 mapping:
728 subjects:
729 - '*:firefox'
730 - 'student:cp'
731
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300732Shared libraries
Nick Metzf04f5f32018-01-08 15:25:04 +0100733~~~~~~~~~~~~~~~~
734
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300735Set additional shared library to Linux system library path:
Nick Metzf04f5f32018-01-08 15:25:04 +0100736
737.. code-block:: yaml
738
739 linux:
740 system:
741 ld:
742 library:
743 java:
744 - /usr/lib/jvm/jre-openjdk/lib/amd64/server
745 - /opt/java/jre/lib/amd64/server
Ondrej Smolaef9bd762018-07-11 14:26:02 +0200746
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200747Certificates
748~~~~~~~~~~~~
749
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300750Add certificate authority into system trusted CA bundle:
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200751
752.. code-block:: yaml
753
754 linux:
755 system:
756 ca_certificates:
757 mycert: |
758 -----BEGIN CERTIFICATE-----
759 MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
760 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
761 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
762 MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
763 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
764 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
765 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
766 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
767 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
768 CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
769 lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
770 AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
771 -----END CERTIFICATE-----
772
Filip Pytloun361096c2017-08-23 10:57:20 +0200773Sysfs
774~~~~~
775
776Install sysfsutils and set sysfs attributes:
777
778.. code-block:: yaml
779
780 linux:
781 system:
782 sysfs:
783 scheduler:
784 block/sda/queue/scheduler: deadline
785 power:
786 mode:
787 power/state: 0660
788 owner:
789 power/state: "root:power"
790 devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
791
Ondrej Smolaef9bd762018-07-11 14:26:02 +0200792Optional: You can also use list that will ensure order of items.
793
794.. code-block:: yaml
795
796 linux:
797 system:
798 sysfs:
799 scheduler:
800 block/sda/queue/scheduler: deadline
801 power:
802 - mode:
803 power/state: 0660
804 - owner:
805 power/state: "root:power"
806 - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
807
Martin Polreich148e1b82018-09-13 15:54:25 +0200808Sysfs definition with disabled automatic write. Attributes are saved
809to configuration, but are not applied during the run.
810Thay will be applied automatically after the reboot.
811
812
813.. code-block:: yaml
814
815 linux:
816 system:
817 sysfs:
818 enable_apply: false
819 scheduler:
820 block/sda/queue/scheduler: deadline
821
822.. note:: The `enable_apply` parameter defaults to `True` if not defined.
823
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100824Huge Pages
825~~~~~~~~~~~~
826
827Huge Pages give a performance boost to applications that intensively deal
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300828with memory allocation/deallocation by decreasing memory fragmentation:
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100829
830.. code-block:: yaml
831
832 linux:
833 system:
834 kernel:
835 hugepages:
836 small:
837 size: 2M
838 count: 107520
839 mount_point: /mnt/hugepages_2MB
Michael Polenchukd9369fe2018-05-08 17:53:08 +0400840 mount: false/true # default is true (mount immediately) / false (just save in the fstab)
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100841 large:
842 default: true # default automatically mounted
843 size: 1G
844 count: 210
845 mount_point: /mnt/hugepages_1GB
846
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300847.. note:: Not recommended to use both pagesizes concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100848
Jakub Pavlik5398d872017-02-13 22:30:47 +0100849Intel SR-IOV
850~~~~~~~~~~~~
851
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300852PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV)
853specification defines a standardized mechanism to virtualize
854PCIe devices. The mechanism can virtualize a single PCIe
855Ethernet controller to appear as multiple PCIe devices:
Jakub Pavlik5398d872017-02-13 22:30:47 +0100856
857.. code-block:: yaml
858
859 linux:
860 system:
861 kernel:
862 sriov: True
863 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
864 rc:
865 local: |
866 #!/bin/sh -e
867 # Enable 7 VF on eth1
868 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
869 exit 0
870
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100871Isolate CPU options
872~~~~~~~~~~~~~~~~~~~
873
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300874Remove the specified CPUs, as defined by the cpu_number values, from
875the general kernel SMP balancing and scheduler algroithms. The only
876way to move a process onto or off an *isolated* CPU is via the CPU
877affinity syscalls. ``cpu_number begins`` at ``0``, so the
878maximum value is ``1`` less than the number of CPUs on the system.:
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100879
880.. code-block:: yaml
881
882 linux:
883 system:
884 kernel:
885 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100886
Filip Pytlounf5383a42015-10-06 16:28:32 +0200887Repositories
888~~~~~~~~~~~~
889
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300890RedHat-based Linux with additional OpenStack repo:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200891
892.. code-block:: yaml
893
894 linux:
895 system:
896 ...
897 repo:
898 rdo-icehouse:
899 enabled: true
900 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
901 pgpcheck: 0
902
903Ensure system repository to use czech Debian mirror (``default: true``)
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300904Also pin it's packages with priority ``900``:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200905
906.. code-block:: yaml
907
908 linux:
909 system:
910 repo:
911 debian:
912 default: true
913 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
914 # Import signing key from URL if needed
915 key_url: "http://dummy.com/public.gpg"
916 pin:
917 - pin: 'origin "ftp.cz.debian.org"'
918 priority: 900
919 package: '*'
920
azvyagintsev4494a472018-09-14 19:19:23 +0300921If you need to add multiple pin rules for one repo, please use new,ordered definition format
922('pinning' definition will be in priotity to use):
923
924.. code-block:: yaml
925
926 linux:
927 system:
928 repo:
929 mcp_saltstack:
930 source: "deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main"
931 architectures: amd64
932 clean_file: true
933 pinning:
934 10:
935 enabled: true
936 pin: 'release o=SaltStack'
937 priority: 50
938 package: 'libsodium18'
939 20:
940 enabled: true
941 pin: 'release o=SaltStack'
942 priority: 1100
943 package: '*'
944
945
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300946.. note:: For old Ubuntu releases (<xenial)
azvyagintsevff089d22018-07-27 16:52:34 +0200947 extra packages for apt transport, like ``apt-transport-https``
948 may be required to be installed manually.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300949 (Chicken-eggs issue: we need to install packages to
azvyagintsevff089d22018-07-27 16:52:34 +0200950 reach repo from where they should be installed)
951 Otherwise, you still can try 'fortune' and install prereq.packages before
952 any repo configuration, using list of requires in map.jinja.
953
954
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300955Disabling any prerequisite packages installation:
956
azvyagintsevff089d22018-07-27 16:52:34 +0200957You can simply drop any package pre-installation (before system.linux.repo
958will be processed) via cluster lvl:
959
960.. code-block:: yaml
961
962 linux:
963 system:
964 pkgs: ~
965
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300966Package manager proxy global setup:
Petr Michalec10462bb2017-03-23 19:18:08 +0100967
968.. code-block:: yaml
969
970 linux:
971 system:
972 ...
973 repo:
974 apt-mk:
975 source: "deb http://apt-mk.mirantis.com/ stable main salt"
976 ...
977 proxy:
978 pkg:
979 enabled: true
980 ftp: ftp://ftp-proxy-for-apt.host.local:2121
981 ...
982 # NOTE: Global defaults for any other componet that configure proxy on the system.
983 # If your environment has just one simple proxy, set it on linux:system:proxy.
984 #
985 # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
986 # as for https and http
987 ftp: ftp://proxy.host.local:2121
988 http: http://proxy.host.local:3142
989 https: https://proxy.host.local:3143
990
991Package manager proxy setup per repository:
992
993.. code-block:: yaml
994
995 linux:
996 system:
997 ...
998 repo:
999 debian:
1000 source: "deb http://apt-mk.mirantis.com/ stable main salt"
1001 ...
1002 apt-mk:
1003 source: "deb http://apt-mk.mirantis.com/ stable main salt"
1004 # per repository proxy
1005 proxy:
1006 enabled: true
1007 http: http://maas-01:8080
1008 https: http://maas-01:8080
1009 ...
1010 proxy:
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001011 # package manager fallback defaults
Petr Michalec10462bb2017-03-23 19:18:08 +01001012 # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
1013 pkg:
1014 enabled: true
1015 ftp: ftp://proxy.host.local:2121
1016 #http: http://proxy.host.local:3142
1017 #https: https://proxy.host.local:3143
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001018 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001019 # global system fallback system defaults
1020 ftp: ftp://proxy.host.local:2121
1021 http: http://proxy.host.local:3142
1022 https: https://proxy.host.local:3143
1023
Jiri Broulik34a29b42017-04-25 14:42:54 +02001024Remove all repositories:
1025
1026.. code-block:: yaml
1027
1028 linux:
1029 system:
1030 purge_repos: true
1031
azvyagintsevff089d22018-07-27 16:52:34 +02001032Refresh repositories metada, after configuration:
1033
1034.. code-block:: yaml
1035
1036 linux:
1037 system:
1038 refresh_repos_meta: true
1039
Filip Pytlounc512e6c2017-11-22 14:28:10 +01001040Setup custom apt config options:
1041
1042.. code-block:: yaml
1043
1044 linux:
1045 system:
1046 apt:
1047 config:
1048 compression-workaround:
1049 "Acquire::CompressionTypes::Order": "gz"
1050 docker-clean:
1051 "DPkg::Post-Invoke":
1052 - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
1053 "APT::Update::Post-Invoke":
1054 - "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 +02001055
Petr Michalec10462bb2017-03-23 19:18:08 +01001056RC
1057~~
1058
Jakub Pavlik78859382016-01-21 11:26:39 +01001059rc.local example
1060
1061.. code-block:: yaml
1062
1063 linux:
1064 system:
1065 rc:
1066 local: |
1067 #!/bin/sh -e
1068 #
1069 # rc.local
1070 #
1071 # This script is executed at the end of each multiuser runlevel.
1072 # Make sure that the script will "exit 0" on success or any other
1073 # value on error.
1074 #
1075 # In order to enable or disable this script just change the execution
1076 # bits.
1077 #
1078 # By default this script does nothing.
1079 exit 0
1080
Filip Pytloun1f40dac2016-01-22 15:52:57 +01001081Prompt
1082~~~~~~
1083
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001084Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``.
1085Every user can have different prompt:
Filip Pytloun1f40dac2016-01-22 15:52:57 +01001086
1087.. code-block:: yaml
1088
1089 linux:
1090 system:
1091 prompt:
1092 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\\]
1093 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
1094
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001095On Debian systems, to set prompt system-wide, it's necessary to
1096remove setting PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc``,
1097which comes from ``/etc/skel/.bashrc``. This formula will do
1098this automatically, but will not touch existing user's
1099``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +01001100
Filip Pytlouneef11c12016-03-25 11:00:23 +01001101Bash
1102~~~~
1103
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001104Fix bash configuration to preserve history across sessions
1105like ZSH does by default:
Filip Pytlouneef11c12016-03-25 11:00:23 +01001106
1107.. code-block:: yaml
1108
1109 linux:
1110 system:
1111 bash:
1112 preserve_history: true
1113
Dmitry Teselkin949398e2018-05-03 15:50:00 +03001114Login banner message
1115~~~~~~~~~~~~~~~~~~~~
1116
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001117``/etc/issue`` is a text file which contains a message or system
1118identification to be printed before the login prompt. It may contain
Dmitry Teselkin949398e2018-05-03 15:50:00 +03001119various @char and \char sequences, if supported by the getty-type
1120program employed on the system.
1121
1122Setting logon banner message is easy:
1123
1124.. code-block:: yaml
1125
1126 liunx:
1127 system:
1128 banner:
1129 enabled: true
1130 contents: |
1131 UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
1132
1133 You must have explicit, authorized permission to access or configure this
1134 device. Unauthorized attempts and actions to access or use this system may
1135 result in civil and/or criminal penalties.
1136 All activities performed on this system are logged and monitored.
1137
Filip Pytloune874dfb2016-01-22 16:57:34 +01001138Message of the day
1139~~~~~~~~~~~~~~~~~~
1140
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001141``pam_motd`` from package ``libpam-modules`` is used for dynamic
1142messages of the day. Setting custom ``motd`` will clean up existing ones.
Filip Pytloune874dfb2016-01-22 16:57:34 +01001143
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001144Setting static ``motd`` will replace existing ``/etc/motd`` and remove
1145scripts from ``/etc/update-motd.d``.
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001146
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001147Setting static ``motd``:
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001148
1149.. code-block:: yaml
1150
1151 linux:
1152 system:
1153 motd: |
1154 UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
1155
1156 You must have explicit, authorized permission to access or configure this
1157 device. Unauthorized attempts and actions to access or use this system may
1158 result in civil and/or criminal penalties.
1159 All activities performed on this system are logged and monitored.
1160
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001161Setting dynamic ``motd``:
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001162
Filip Pytloune874dfb2016-01-22 16:57:34 +01001163.. code-block:: yaml
1164
1165 linux:
1166 system:
1167 motd:
1168 - release: |
1169 #!/bin/sh
1170 [ -r /etc/lsb-release ] && . /etc/lsb-release
1171
1172 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
1173 # Fall back to using the very slow lsb_release utility
1174 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
1175 fi
1176
1177 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
1178 - warning: |
1179 #!/bin/sh
1180 printf "This is [company name] network.\n"
1181 printf "Unauthorized access strictly prohibited.\n"
1182
Marek Celoud713e9072017-05-18 15:20:25 +02001183Services
1184~~~~~~~~
1185
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001186Stop and disable the ``linux`` service:
Marek Celoud713e9072017-05-18 15:20:25 +02001187
1188.. code-block:: yaml
1189
1190 linux:
1191 system:
1192 service:
1193 apt-daily.timer:
1194 status: dead
1195
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001196Possible statuses are ``dead`` (disable service by default), ``running``
1197(enable service by default), ``enabled``, ``disabled``:
Marek Celoud713e9072017-05-18 15:20:25 +02001198
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001199Linux with the ``atop`` service:
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +03001200
1201.. code-block:: yaml
1202
1203 linux:
1204 system:
1205 atop:
1206 enabled: true
1207 interval: 20
1208 logpath: "/var/log/atop"
1209 outfile: "/var/log/atop/daily.log"
1210
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001211Linux with the ``mcelog`` service:
Oleksii Chupryn144432b2018-05-22 10:34:48 +03001212
1213.. code-block:: yaml
1214
1215 linux:
1216 system:
1217 mcelog:
1218 enabled: true
1219 logging:
1220 syslog: true
1221 syslog_error: true
1222
Filip Pytloun2f70b492016-02-19 15:55:25 +01001223RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +01001224^^^^^^^^^^^^^
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001225Currently, ``update-motd`` is not available
1226for RHEL. So there is no native support for dynamic ``motd``.
1227You can still set a static one, with a different pillar structure:
Filip Pytloun2f70b492016-02-19 15:55:25 +01001228
1229.. code-block:: yaml
1230
1231 linux:
1232 system:
1233 motd: |
1234 This is [company name] network.
1235 Unauthorized access strictly prohibited.
1236
Filip Pytloun8296bb92016-02-19 18:42:09 +01001237Haveged
1238~~~~~~~
1239
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001240If you are running headless server and are low on entropy,
1241you may set up Haveged:
Filip Pytloun8296bb92016-02-19 18:42:09 +01001242
1243.. code-block:: yaml
1244
1245 linux:
1246 system:
1247 haveged:
1248 enabled: true
1249
Filip Pytlounf5383a42015-10-06 16:28:32 +02001250Linux network
1251-------------
1252
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001253Linux with network manager:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001254
1255.. code-block:: yaml
1256
1257 linux:
1258 network:
1259 enabled: true
1260 network_manager: true
1261
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001262Linux with default static network interfaces, default gateway
1263interface and DNS servers:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001264
1265.. code-block:: yaml
1266
1267 linux:
1268 network:
1269 enabled: true
1270 interface:
1271 eth0:
1272 enabled: true
1273 type: eth
1274 address: 192.168.0.102
1275 netmask: 255.255.255.0
1276 gateway: 192.168.0.1
1277 name_servers:
1278 - 8.8.8.8
1279 - 8.8.4.4
1280 mtu: 1500
1281
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001282Linux with bonded interfaces and disabled ``NetworkManager``:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001283
1284.. code-block:: yaml
1285
1286 linux:
1287 network:
1288 enabled: true
1289 interface:
1290 eth0:
1291 type: eth
1292 ...
1293 eth1:
1294 type: eth
1295 ...
1296 bond0:
1297 enabled: true
1298 type: bond
1299 address: 192.168.0.102
1300 netmask: 255.255.255.0
1301 mtu: 1500
1302 use_in:
1303 - interface: ${linux:interface:eth0}
1304 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +01001305 network_manager:
1306 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001307
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001308Linux with VLAN ``interface_params``:
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001309
1310.. code-block:: yaml
1311
1312 linux:
1313 network:
1314 enabled: true
1315 interface:
1316 vlan69:
1317 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +01001318 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001319 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001320
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001321Linux with wireless interface parameters:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001322
1323.. code-block:: yaml
1324
1325 linux:
1326 network:
1327 enabled: true
1328 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001329 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +02001330 interface:
1331 wlan0:
1332 type: eth
1333 wireless:
1334 essid: example
1335 key: example_key
1336 security: wpa
1337 priority: 1
1338
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001339Linux networks with routes defined:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001340
1341.. code-block:: yaml
1342
1343 linux:
1344 network:
1345 enabled: true
1346 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001347 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +02001348 interface:
1349 eth0:
1350 type: eth
1351 route:
1352 default:
1353 address: 192.168.0.123
1354 netmask: 255.255.255.0
1355 gateway: 192.168.0.1
1356
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001357Native Linux Bridges:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001358
1359.. code-block:: yaml
1360
1361 linux:
1362 network:
1363 interface:
1364 eth1:
1365 enabled: true
1366 type: eth
1367 proto: manual
1368 up_cmds:
1369 - ip address add 0/0 dev $IFACE
1370 - ip link set $IFACE up
1371 down_cmds:
1372 - ip link set $IFACE down
1373 br-ex:
1374 enabled: true
1375 type: bridge
1376 address: ${linux:network:host:public_local:address}
1377 netmask: 255.255.255.0
1378 use_interfaces:
1379 - eth1
1380
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001381Open vSwitch Bridges:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001382
1383.. code-block:: yaml
1384
1385 linux:
1386 network:
1387 bridge: openvswitch
1388 interface:
1389 eth1:
1390 enabled: true
1391 type: eth
1392 proto: manual
1393 up_cmds:
1394 - ip address add 0/0 dev $IFACE
1395 - ip link set $IFACE up
1396 down_cmds:
1397 - ip link set $IFACE down
1398 br-ex:
1399 enabled: true
1400 type: bridge
1401 address: ${linux:network:host:public_local:address}
1402 netmask: 255.255.255.0
1403 use_interfaces:
1404 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001405 br-prv:
1406 enabled: true
1407 type: ovs_bridge
1408 mtu: 65000
1409 br-ens7:
1410 enabled: true
1411 name: br-ens7
1412 type: ovs_bridge
1413 proto: manual
1414 mtu: 9000
1415 use_interfaces:
1416 - ens7
1417 patch-br-ens7-br-prv:
1418 enabled: true
1419 name: ens7-prv
1420 ovs_type: ovs_port
1421 type: ovs_port
1422 bridge: br-ens7
1423 port_type: patch
1424 peer: prv-ens7
Oleksii Chupryn694ee722018-06-13 14:08:58 +03001425 tag: 109 # [] to unset a tag
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001426 mtu: 65000
1427 patch-br-prv-br-ens7:
1428 enabled: true
1429 name: prv-ens7
1430 bridge: br-prv
1431 ovs_type: ovs_port
1432 type: ovs_port
1433 port_type: patch
1434 peer: ens7-prv
Oleksii Chupryn694ee722018-06-13 14:08:58 +03001435 tag: 109
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001436 mtu: 65000
1437 ens7:
1438 enabled: true
1439 name: ens7
1440 proto: manual
1441 ovs_port_type: OVSPort
1442 type: ovs_port
1443 ovs_bridge: br-ens7
1444 bridge: br-ens7
Filip Pytlounf5383a42015-10-06 16:28:32 +02001445
Petr Jediný8f8ae542017-07-13 16:19:12 +02001446Debian manual proto interfaces
1447
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001448When you are changing interface proto from static in up state
1449to manual, you may need to flush ip addresses. For example,
1450if you want to use the interface and the ip on the bridge.
1451This can be done by setting the ``ipflush_onchange`` to true.
Petr Jediný8f8ae542017-07-13 16:19:12 +02001452
1453.. code-block:: yaml
1454
1455 linux:
1456 network:
1457 interface:
1458 eth1:
1459 enabled: true
1460 type: eth
1461 proto: manual
1462 mtu: 9100
1463 ipflush_onchange: true
1464
Jiri Broulik1a191e32018-01-15 15:54:21 +01001465Debian static proto interfaces
1466
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001467When you are changing interface proto from dhcp in up state to
1468static, you may need to flush ip addresses and restart interface
1469to assign ip address from a managed file. For example, if you wantto
1470use the interface and the ip on the bridge. This can be done by
1471setting the ``ipflush_onchange`` with combination ``restart_on_ipflush``
1472param set to true.
Jiri Broulik1a191e32018-01-15 15:54:21 +01001473
1474.. code-block:: yaml
1475
1476 linux:
1477 network:
1478 interface:
1479 eth1:
1480 enabled: true
1481 type: eth
1482 proto: static
1483 address: 10.1.0.22
1484 netmask: 255.255.255.0
1485 ipflush_onchange: true
1486 restart_on_ipflush: true
Petr Jediný8f8ae542017-07-13 16:19:12 +02001487
Petr Jedinýd577cb52017-06-28 20:17:49 +02001488Concatinating and removing interface files
1489
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001490Debian based distributions have ``/etc/network/interfaces.d/``
1491directory, where you can store configuration of network
1492interfaces in separate files. You can concatinate the files
1493to the defined destination when needed, this operation removes
1494the file from the ``/etc/network/interfaces.d/``. If you just need
1495to remove iface files, you can use the ``remove_iface_files`` key.
Petr Jedinýd577cb52017-06-28 20:17:49 +02001496
1497.. code-block:: yaml
1498
1499 linux:
1500 network:
1501 concat_iface_files:
1502 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
1503 dst: '/etc/network/interfaces'
1504 remove_iface_files:
1505 - '/etc/network/interfaces.d/90-custom.cfg'
1506
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001507Configure DHCP client
Petr Jedinýd577cb52017-06-28 20:17:49 +02001508
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001509None of the keys is mandatory, include only those you really need.
1510For full list of available options under send, supersede, prepend,
1511append refer to dhcp-options(5).
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001512
1513.. code-block:: yaml
1514
1515 linux:
1516 network:
1517 dhclient:
1518 enabled: true
1519 backoff_cutoff: 15
1520 initial_interval: 10
1521 reboot: 10
1522 retry: 60
1523 select_timeout: 0
1524 timeout: 120
1525 send:
1526 - option: host-name
1527 declaration: "= gethostname()"
1528 supersede:
1529 - option: host-name
1530 declaration: "spaceship"
1531 - option: domain-name
1532 declaration: "domain.home"
1533 #- option: arp-cache-timeout
1534 # declaration: 20
1535 prepend:
1536 - option: domain-name-servers
1537 declaration:
1538 - 8.8.8.8
1539 - 8.8.4.4
1540 - option: domain-search
1541 declaration:
1542 - example.com
1543 - eng.example.com
1544 #append:
1545 #- option: domain-name-servers
1546 # declaration: 127.0.0.1
1547 # ip or subnet to reject dhcp offer from
1548 reject:
1549 - 192.33.137.209
1550 - 10.0.2.0/24
1551 request:
1552 - subnet-mask
1553 - broadcast-address
1554 - time-offset
1555 - routers
1556 - domain-name
1557 - domain-name-servers
1558 - domain-search
1559 - host-name
1560 - dhcp6.name-servers
1561 - dhcp6.domain-search
1562 - dhcp6.fqdn
1563 - dhcp6.sntp-servers
1564 - netbios-name-servers
1565 - netbios-scope
1566 - interface-mtu
1567 - rfc3442-classless-static-routes
1568 - ntp-servers
1569 require:
1570 - subnet-mask
1571 - domain-name-servers
1572 # if per interface configuration required add below
1573 interface:
1574 ens2:
1575 initial_interval: 11
1576 reject:
1577 - 192.33.137.210
1578 ens3:
1579 initial_interval: 12
1580 reject:
1581 - 192.33.137.211
1582
Petr Michaleceb14b552017-06-01 10:27:05 +02001583Linux network systemd settings:
1584
1585.. code-block:: yaml
1586
1587 linux:
1588 network:
1589 ...
1590 systemd:
1591 link:
1592 10-iface-dmz:
1593 Match:
1594 MACAddress: c8:5b:67:fa:1a:af
1595 OriginalName: eth0
1596 Link:
1597 Name: dmz0
1598 netdev:
1599 20-bridge-dmz:
1600 match:
1601 name: dmz0
1602 network:
1603 mescription: bridge
1604 bridge: br-dmz0
1605 network:
1606 # works with lowercase, keys are by default capitalized
1607 40-dhcp:
1608 match:
1609 name: '*'
1610 network:
1611 DHCP: yes
1612
Petr Michalec10462bb2017-03-23 19:18:08 +01001613Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001614
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001615Use ``/etc/environment`` for static system wide variable assignment
1616after boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001617
1618.. code-block:: yaml
1619
1620 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001621 system:
1622 env:
1623 BOB_VARIABLE: Alice
1624 ...
1625 BOB_PATH:
1626 - /srv/alice/bin
1627 - /srv/bob/bin
1628 ...
1629 ftp_proxy: none
1630 http_proxy: http://global-http-proxy.host.local:8080
1631 https_proxy: ${linux:system:proxy:https}
1632 no_proxy:
1633 - 192.168.0.80
1634 - 192.168.1.80
1635 - .domain.com
1636 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001637 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001638 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001639 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001640 ftp: ftp://proxy.host.local:2121
1641 http: http://proxy.host.local:3142
1642 https: https://proxy.host.local:3143
1643 noproxy:
1644 - .domain.com
1645 - .local
1646
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001647Configure the ``profile.d`` scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001648
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001649The ``profile.d`` scripts are being sourced during ``.sh`` execution
1650and support variable expansion in opposite to /etc/environment global
1651settings in ``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001652
1653.. code-block:: yaml
1654
1655 linux:
1656 system:
1657 profile:
1658 locales: |
1659 export LANG=C
1660 export LC_ALL=C
1661 ...
1662 vi_flavors.sh: |
1663 export PAGER=view
1664 export EDITOR=vim
1665 alias vi=vim
1666 shell_locales.sh: |
1667 export LANG=en_US
1668 export LC_ALL=en_US.UTF-8
1669 shell_proxies.sh: |
1670 export FTP_PROXY=ftp://127.0.3.3:2121
1671 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001672
Dmitry Teselkina0d31d12018-09-04 14:43:09 +03001673
1674Configure login.defs parameters
1675-------------------------------
1676
1677.. code-block:: yaml
1678
1679 linux:
1680 system:
1681 login_defs:
1682 <opt_name>:
1683 enabled: true
1684 value: <opt_value>
1685
1686<opt_name> is a configurational option defined in 'man login.defs'.
1687<opt_name> is case sensitive, should be UPPERCASE only!
1688
1689
Filip Pytlounf5383a42015-10-06 16:28:32 +02001690Linux with hosts
1691
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001692Parameter ``purge_hosts`` will enforce whole ``/etc/hosts file``,
1693removing entries that are not defined in model except defaults
1694for both IPv4 and IPv6 localhost and hostname as well as FQDN.
Ales Komarek417e8c52017-08-25 15:10:29 +02001695
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001696We recommend using this option to verify that ``/etc/hosts``
1697is always in a clean state. However it is not enabled by default
1698for security reasons.
Filip Pytloun86506fe2017-01-26 14:36:16 +01001699
Filip Pytlounf5383a42015-10-06 16:28:32 +02001700.. code-block:: yaml
1701
1702 linux:
1703 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001704 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001705 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001706 # No need to define this one if purge_hosts is true
1707 hostname:
1708 address: 127.0.1.1
1709 names:
1710 - ${linux:network:fqdn}
1711 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02001712 node1:
1713 address: 192.168.10.200
1714 names:
1715 - node2.domain.com
1716 - service2.domain.com
1717 node2:
1718 address: 192.168.10.201
1719 names:
1720 - node2.domain.com
1721 - service2.domain.com
1722
Ales Komarek417e8c52017-08-25 15:10:29 +02001723Linux with hosts collected from mine
1724
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001725All DNS records defined within infrastrucuture
1726are passed to the local hosts records or any DNS server. Only
1727hosts with the ``grain`` parameter set to ``true`` will be propagated
1728to the mine.
Ales Komarek417e8c52017-08-25 15:10:29 +02001729
1730.. code-block:: yaml
1731
1732 linux:
1733 network:
1734 purge_hosts: true
1735 mine_dns_records: true
1736 host:
1737 node1:
1738 address: 192.168.10.200
1739 grain: true
1740 names:
1741 - node2.domain.com
1742 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01001743
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001744Set up ``resolv.conf``, nameservers, domain and search domains:
Filip Pytlounde9bea52016-01-11 15:39:10 +01001745
1746.. code-block:: yaml
1747
1748 linux:
1749 network:
1750 resolv:
1751 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001752 - 8.8.4.4
1753 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01001754 domain: my.example.com
1755 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001756 - my.example.com
1757 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01001758 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001759 - ndots: 5
1760 - timeout: 2
1761 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +01001762
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001763Set up custom TX queue length for tap interfaces:
Andrii Petrenko735761d2017-03-21 17:17:35 -07001764
1765.. code-block:: yaml
1766
1767 linux:
1768 network:
1769 tap_custom_txqueuelen: 10000
1770
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001771DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001772
1773**DPDK OVS NIC**
1774
1775.. code-block:: yaml
1776
1777 linux:
1778 network:
1779 bridge: openvswitch
1780 dpdk:
1781 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001782 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001783 openvswitch:
1784 pmd_cpu_mask: "0x6"
1785 dpdk_socket_mem: "1024,1024"
1786 dpdk_lcore_mask: "0x400"
1787 memory_channels: 2
1788 interface:
1789 dpkd0:
1790 name: ${_param:dpdk_nic}
1791 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001792 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001793 enabled: true
1794 type: dpdk_ovs_port
1795 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001796 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001797 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01001798 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001799 br-prv:
1800 enabled: true
1801 type: dpdk_ovs_bridge
1802
1803**DPDK OVS Bond**
1804
1805.. code-block:: yaml
1806
1807 linux:
1808 network:
1809 bridge: openvswitch
1810 dpdk:
1811 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001812 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001813 openvswitch:
1814 pmd_cpu_mask: "0x6"
1815 dpdk_socket_mem: "1024,1024"
1816 dpdk_lcore_mask: "0x400"
1817 memory_channels: 2
1818 interface:
1819 dpdk_second_nic:
1820 name: ${_param:primary_second_nic}
1821 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001822 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001823 bond: dpdkbond0
1824 enabled: true
1825 type: dpdk_ovs_port
1826 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001827 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001828 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001829 dpdk_first_nic:
1830 name: ${_param:primary_first_nic}
1831 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001832 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001833 bond: dpdkbond0
1834 enabled: true
1835 type: dpdk_ovs_port
1836 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001837 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001838 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001839 dpdkbond0:
1840 enabled: true
1841 bridge: br-prv
1842 type: dpdk_ovs_bond
1843 mode: active-backup
1844 br-prv:
1845 enabled: true
1846 type: dpdk_ovs_bridge
1847
Dzmitry Stremkouskif619b072018-03-15 20:13:42 +01001848**DPDK OVS LACP Bond with vlan tag**
1849
1850.. code-block:: yaml
1851
1852 linux:
1853 network:
1854 bridge: openvswitch
1855 dpdk:
1856 enabled: true
1857 driver: uio
1858 openvswitch:
1859 pmd_cpu_mask: "0x6"
1860 dpdk_socket_mem: "1024,1024"
1861 dpdk_lcore_mask: "0x400"
1862 memory_channels: "2"
1863 interface:
1864 eth3:
1865 enabled: true
1866 type: eth
1867 proto: manual
1868 name: ${_param:tenant_first_nic}
1869 eth4:
1870 enabled: true
1871 type: eth
1872 proto: manual
1873 name: ${_param:tenant_second_nic}
1874 dpdk0:
1875 name: ${_param:tenant_first_nic}
1876 pci: "0000:81:00.0"
1877 driver: igb_uio
1878 bond: bond1
1879 enabled: true
1880 type: dpdk_ovs_port
1881 n_rxq: 2
1882 dpdk1:
1883 name: ${_param:tenant_second_nic}
1884 pci: "0000:81:00.1"
1885 driver: igb_uio
1886 bond: bond1
1887 enabled: true
1888 type: dpdk_ovs_port
1889 n_rxq: 2
1890 bond1:
1891 enabled: true
1892 bridge: br-prv
1893 type: dpdk_ovs_bond
1894 mode: balance-slb
1895 br-prv:
1896 enabled: true
1897 type: dpdk_ovs_bridge
1898 tag: ${_param:tenant_vlan}
1899 address: ${_param:tenant_address}
1900 netmask: ${_param:tenant_network_netmask}
1901
Jakub Pavlikaa759062017-03-13 15:57:26 +01001902**DPDK OVS bridge for VXLAN**
1903
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001904If VXLAN is used as tenant segmentation, IP address must
1905be set on ``br-prv``.
Jakub Pavlikaa759062017-03-13 15:57:26 +01001906
1907.. code-block:: yaml
1908
1909 linux:
1910 network:
1911 ...
1912 interface:
1913 br-prv:
1914 enabled: true
1915 type: dpdk_ovs_bridge
1916 address: 192.168.50.0
1917 netmask: 255.255.255.0
Michael Polenchukd173d552018-01-22 15:22:47 +04001918 tag: 101
Jakub Pavlikaa759062017-03-13 15:57:26 +01001919 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001920
Oleksii Chupryne2151ff2018-03-13 16:01:12 +02001921**DPDK OVS bridge with Linux network interface**
1922
1923.. code-block:: yaml
1924
1925 linux:
1926 network:
1927 ...
1928 interface:
1929 eth0:
1930 type: eth
1931 ovs_bridge: br-prv
1932 ...
1933 br-prv:
1934 enabled: true
1935 type: dpdk_ovs_bridge
1936 ...
1937
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001938Linux storage
1939-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02001940
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001941Linux with mounted Samba:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001942
1943.. code-block:: yaml
1944
1945 linux:
1946 storage:
1947 enabled: true
1948 mount:
1949 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01001950 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001951 - path: /media/myuser/public/
1952 - device: //192.168.0.1/storage
1953 - file_system: cifs
1954 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
1955
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001956NFS mount:
Jiri Broulikb017f932017-03-31 13:55:36 +02001957
1958.. code-block:: yaml
1959
1960 linux:
1961 storage:
1962 enabled: true
1963 mount:
1964 nfs_glance:
1965 enabled: true
1966 path: /var/lib/glance/images
1967 device: 172.16.10.110:/var/nfs/glance
1968 file_system: nfs
1969 opts: rw,sync
1970
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001971File swap configuration:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001972
1973.. code-block:: yaml
1974
1975 linux:
1976 storage:
1977 enabled: true
1978 swap:
1979 file:
1980 enabled: true
1981 engine: file
1982 device: /swapfile
1983 size: 1024
1984
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001985Partition swap configuration:
Lachlan Evenson30676512016-01-22 15:43:28 -08001986
1987.. code-block:: yaml
1988
1989 linux:
1990 storage:
1991 enabled: true
1992 swap:
1993 partition:
1994 enabled: true
1995 engine: partition
1996 device: /dev/vg0/swap
1997
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001998LVM group ``vg1`` with one device and ``data`` volume mounted
1999into ``/mnt/data``.
Filip Pytlounc8a001a2015-12-15 14:09:19 +01002000
2001.. code-block:: yaml
2002
2003 parameters:
2004 linux:
2005 storage:
2006 mount:
2007 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01002008 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01002009 device: /dev/vg1/data
2010 file_system: ext4
2011 path: /mnt/data
2012 lvm:
2013 vg1:
2014 enabled: true
2015 devices:
2016 - /dev/sdb
2017 volume:
2018 data:
2019 size: 40G
2020 mount: ${linux:storage:mount:data}
2021
Jakub Pavlik4f742142017-08-08 15:05:50 +02002022Create partitions on disk. Specify size in MB. It expects empty
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002023disk without any existing partitions.
2024Set ``startsector=1`` if you want to start partitions from ``2048``.
Jakub Pavlik4f742142017-08-08 15:05:50 +02002025
2026.. code-block:: yaml
2027
2028 linux:
2029 storage:
2030 disk:
2031 first_drive:
Piotr Krukd51911b2017-12-04 11:27:08 +01002032 startsector: 1
Jakub Pavlik4f742142017-08-08 15:05:50 +02002033 name: /dev/loop1
2034 type: gpt
2035 partitions:
2036 - size: 200 #size in MB
2037 type: fat32
2038 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02002039 mkfs: True
2040 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02002041 /dev/vda1:
2042 partitions:
2043 - size: 5
2044 type: ext2
2045 - size: 10
2046 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02002047
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002048Multipath with Fujitsu Eternus DXL:
Ales Komareka634f4b2016-10-02 13:11:04 +02002049
2050.. code-block:: yaml
2051
2052 parameters:
2053 linux:
2054 storage:
2055 multipath:
2056 enabled: true
2057 blacklist_devices:
2058 - /dev/sda
2059 - /dev/sdb
2060 backends:
2061 - fujitsu_eternus_dxl
2062
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002063Multipath with Hitachi VSP 1000:
Ales Komareka634f4b2016-10-02 13:11:04 +02002064
2065.. code-block:: yaml
2066
2067 parameters:
2068 linux:
2069 storage:
2070 multipath:
2071 enabled: true
2072 blacklist_devices:
2073 - /dev/sda
2074 - /dev/sdb
2075 backends:
2076 - hitachi_vsp1000
2077
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002078Multipath with IBM Storwize:
Ales Komareka634f4b2016-10-02 13:11:04 +02002079
2080.. code-block:: yaml
2081
2082 parameters:
2083 linux:
2084 storage:
2085 multipath:
2086 enabled: true
2087 blacklist_devices:
2088 - /dev/sda
2089 - /dev/sdb
2090 backends:
2091 - ibm_storwize
2092
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002093Multipath with multiple backends:
Ales Komareka634f4b2016-10-02 13:11:04 +02002094
2095.. code-block:: yaml
2096
2097 parameters:
2098 linux:
2099 storage:
2100 multipath:
2101 enabled: true
2102 blacklist_devices:
2103 - /dev/sda
2104 - /dev/sdb
2105 - /dev/sdc
2106 - /dev/sdd
2107 backends:
2108 - ibm_storwize
2109 - fujitsu_eternus_dxl
2110 - hitachi_vsp1000
2111
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002112PAM LDAP integration:
Dmitry Stremkouski7d8d67a2017-11-15 13:08:19 +03002113
2114.. code-block:: yaml
2115
2116 parameters:
2117 linux:
2118 system:
2119 auth:
2120 enabled: true
Dzmitry Stremkouski602735d2018-05-09 22:31:39 +02002121 mkhomedir:
2122 enabled: true
2123 umask: 0027
Dmitry Stremkouski7d8d67a2017-11-15 13:08:19 +03002124 ldap:
2125 enabled: true
2126 binddn: cn=bind,ou=service_users,dc=example,dc=com
2127 bindpw: secret
2128 uri: ldap://127.0.0.1
2129 base: ou=users,dc=example,dc=com
2130 ldap_version: 3
2131 pagesize: 65536
2132 referrals: off
2133 filter:
2134 passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
2135 shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
2136 group: (&(objectClass=group)(gidNumber=*))
2137
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002138Disabled multipath (the default setup):
Ales Komareka634f4b2016-10-02 13:11:04 +02002139
2140.. code-block:: yaml
2141
2142 parameters:
2143 linux:
2144 storage:
2145 multipath:
2146 enabled: false
2147
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002148Linux with local loopback device:
Simon Pasquier375001e2017-01-26 13:22:33 +01002149
2150.. code-block:: yaml
2151
2152 linux:
2153 storage:
2154 loopback:
2155 disk1:
2156 file: /srv/disk1
2157 size: 50G
2158
Filip Pytlounb2c8f852016-11-21 17:03:43 +01002159External config generation
2160--------------------------
2161
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002162You are able to use config support metadata between formulas
2163and only generate configuration files for external use, for example, Docker, and so on.
Filip Pytlounb2c8f852016-11-21 17:03:43 +01002164
2165.. code-block:: yaml
2166
2167 parameters:
2168 linux:
2169 system:
2170 config:
2171 pillar:
2172 jenkins:
2173 master:
2174 home: /srv/volumes/jenkins
2175 approved_scripts:
2176 - method java.net.URL openConnection
2177 credentials:
2178 - type: username_password
2179 scope: global
2180 id: test
2181 desc: Testing credentials
2182 username: test
2183 password: test
2184
Vladimir Ereminccf28842017-04-10 23:52:10 +03002185Netconsole Remote Kernel Logging
2186--------------------------------
2187
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002188Netconsole logger can be configured for the configfs-enabled kernels
2189(``CONFIG_NETCONSOLE_DYNAMIC`` must be enabled). The configuration
2190applies both in runtime (if network is already configured),
2191and on-boot after an interface initialization.
Vladimir Ereminccf28842017-04-10 23:52:10 +03002192
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002193.. note::
2194
2195 * Receiver can be located only on the same L3 domain
2196 (or you need to configure gateway MAC manually).
2197 * The Receiver MAC is detected only on configuration time.
2198 * Using broadcast MAC is not recommended.
Vladimir Ereminccf28842017-04-10 23:52:10 +03002199
2200.. code-block:: yaml
2201
2202 parameters:
2203 linux:
2204 system:
2205 netconsole:
2206 enabled: true
2207 port: 514 (optional)
2208 loglevel: debug (optional)
2209 target:
2210 192.168.0.1:
2211 interface: bond0
2212 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02002213
Filip Pytlounf5383a42015-10-06 16:28:32 +02002214Usage
2215=====
2216
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002217Set MTU of the eth0 network interface to 1400:
Filip Pytlounf5383a42015-10-06 16:28:32 +02002218
2219.. code-block:: bash
2220
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002221 ip link set dev eth0 mtu 1400
Filip Pytlounf5383a42015-10-06 16:28:32 +02002222
2223Read more
2224=========
2225
2226* https://www.archlinux.org/
2227* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01002228
2229Documentation and Bugs
2230======================
2231
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002232* http://salt-formulas.readthedocs.io/
2233 Learn how to install and update salt-formulas.
Filip Pytloun018f8712017-02-02 13:02:03 +01002234
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002235* https://github.com/salt-formulas/salt-formula-linux/issues
2236 In the unfortunate event that bugs are discovered, report the issue to the
2237 appropriate issue tracker. Use the Github issue tracker for a specific salt
2238 formula.
Filip Pytloun018f8712017-02-02 13:02:03 +01002239
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002240* https://launchpad.net/salt-formulas
2241 For feature requests, bug reports, or blueprints affecting the entire
2242 ecosystem, use the Launchpad salt-formulas project.
Filip Pytloun018f8712017-02-02 13:02:03 +01002243
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002244* https://launchpad.net/~salt-formulas-users
2245 Join the salt-formulas-users team and subscribe to mailing list if required.
Filip Pytloun018f8712017-02-02 13:02:03 +01002246
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002247* https://github.com/salt-formulas/salt-formula-linux
2248 Develop the salt-formulas projects in the master branch and then submit pull
2249 requests against a specific formula.
Filip Pytloun018f8712017-02-02 13:02:03 +01002250
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002251* #salt-formulas @ irc.freenode.net
2252 Use this IRC channel in case of any questions or feedback which is always
2253 welcome.
Filip Pytloun018f8712017-02-02 13:02:03 +01002254