blob: 986ec72efbf20b4b54096d2fa62d6693882d7c10 [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
Filip Pytlounf5383a42015-10-06 16:28:32 +0200238Linux with cron jobs
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300239
240By default, it will use name as an identifier, unless identifier key is
Filip Pytloun91222222017-08-04 10:55:27 +0200241explicitly set or False (then it will use Salt's default behavior which is
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300242identifier same as command resulting in not being able to change it):
Filip Pytlounf5383a42015-10-06 16:28:32 +0200243
244.. code-block:: yaml
245
246 linux:
247 system:
248 ...
249 job:
250 cmd1:
251 command: '/cmd/to/run'
Filip Pytloun91222222017-08-04 10:55:27 +0200252 identifier: cmd1
Filip Pytlounf5383a42015-10-06 16:28:32 +0200253 enabled: true
254 user: 'root'
255 hour: 2
256 minute: 0
257
Filip Pytlound0a29e72015-11-30 15:23:34 +0100258Linux security limits (limit sensu user memory usage to max 1GB):
259
260.. code-block:: yaml
261
262 linux:
263 system:
264 ...
265 limit:
266 sensu:
267 enabled: true
268 domain: sensu
269 limits:
270 - type: hard
271 item: as
272 value: 1000000
273
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300274Enable autologin on ``tty1`` (may work only for Ubuntu 14.04):
Filip Pytloun7fee0542015-10-15 11:19:24 +0200275
276.. code-block:: yaml
277
278 linux:
279 system:
280 console:
281 tty1:
282 autologin: root
Filip Pytloun281d0202016-01-29 14:03:51 +0100283 # Enable serial console
284 ttyS0:
285 autologin: root
286 rate: 115200
287 term: xterm
Filip Pytloun7fee0542015-10-15 11:19:24 +0200288
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300289To disable set autologin to ``false``.
Filip Pytloun7fee0542015-10-15 11:19:24 +0200290
Filip Pytloun7731b852016-02-01 11:13:47 +0100291Set ``policy-rc.d`` on Debian-based systems. Action can be any available
292command in ``while true`` loop and ``case`` context.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300293Following will disallow dpkg to stop/start services for the Cassandra
294package automatically:
Filip Pytloun7731b852016-02-01 11:13:47 +0100295
296.. code-block:: yaml
297
298 linux:
299 system:
300 policyrcd:
301 - package: cassandra
302 action: exit 101
303 - package: '*'
304 action: switch
305
Filip Pytlounc49445a2016-04-04 14:23:20 +0200306Set system locales:
307
308.. code-block:: yaml
309
310 linux:
311 system:
312 locale:
313 en_US.UTF-8:
314 default: true
Filip Pytlounee1745f2016-04-04 17:39:41 +0200315 "cs_CZ.UTF-8 UTF-8":
Filip Pytlounc49445a2016-04-04 14:23:20 +0200316 enabled: true
317
Andrey Shestakove7cca052017-05-24 23:06:24 +0300318Systemd settings:
319
320.. code-block:: yaml
321
322 linux:
323 system:
324 ...
325 systemd:
326 system:
327 Manager:
328 DefaultLimitNOFILE: 307200
329 DefaultLimitNPROC: 307200
330 user:
331 Manager:
332 DefaultLimitCPU: 2
333 DefaultLimitNPROC: 4
334
Filip Pytloun8b2131e2017-11-08 13:29:03 +0100335Ensure presence of directory:
336
337.. code-block:: yaml
338
339 linux:
340 system:
341 directory:
342 /tmp/test:
343 user: root
344 group: root
345 mode: 700
346 makedirs: true
347
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300348Ensure presence of file by specifying its source:
Richard Felkl2e07d652018-01-19 10:19:06 +0100349
350.. code-block:: yaml
351
352 linux:
353 system:
354 file:
355 /tmp/test.txt:
356 source: http://example.com/test.txt
Richard Felklf40599a2018-02-06 22:56:41 +0100357 user: root #optional
358 group: root #optional
359 mode: 700 #optional
360 dir_mode: 700 #optional
361 encoding: utf-8 #optional
362 hash: <<hash>> or <<URI to hash>> #optional
363 makedirs: true #optional
364
365 linux:
366 system:
367 file:
368 test.txt:
369 name: /tmp/test.txt
370 source: http://example.com/test.txt
Richard Felkl2e07d652018-01-19 10:19:06 +0100371
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300372Ensure presence of file by specifying its contents:
Richard Felkl2e07d652018-01-19 10:19:06 +0100373
374.. code-block:: yaml
375
376 linux:
377 system:
378 file:
379 /tmp/test.txt:
380 contents: |
381 line1
382 line2
Richard Felklf40599a2018-02-06 22:56:41 +0100383
384 linux:
385 system:
386 file:
387 /tmp/test.txt:
388 contents_pillar: linux:network:hostname
389
390 linux:
391 system:
392 file:
393 /tmp/test.txt:
394 contents_grains: motd
395
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300396Ensure presence of file to be serialized through one of the
397serializer modules (see:
398https://docs.saltstack.com/en/latest/ref/serializers/all/index.html):
Bruno Binet9c2fe222018-06-08 16:57:32 +0200399
400.. code-block:: yaml
401
402 linux:
403 system:
404 file:
405 /tmp/test.json:
406 serialize: json
407 contents:
408 foo: 1
409 bar: 'bar'
410
Filip Pytloun281034a2016-01-04 18:06:22 +0100411Kernel
412~~~~~~
413
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300414Install always up to date LTS kernel and headers from Ubuntu Trusty:
Filip Pytloun281034a2016-01-04 18:06:22 +0100415
416.. code-block:: yaml
417
418 linux:
419 system:
420 kernel:
421 type: generic
422 lts: trusty
423 headers: true
424
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300425Load kernel modules and add them to ``/etc/modules``:
Tomáš Kukrálba35b212017-02-15 17:59:46 +0100426
427.. code-block:: yaml
428
429 linux:
430 system:
431 kernel:
432 modules:
433 - nf_conntrack
434 - tp_smapi
435 - 8021q
436
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300437Configure or blacklist kernel modules with additional options to
438``/etc/modprobe.d`` following example will add
439``/etc/modprobe.d/nf_conntrack.conf`` file with line
440``options nf_conntrack hashsize=262144``:
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300441
Dmitry Teselkin809834c2018-08-13 19:14:42 +0300442'option' can be a mapping (with 'enabled' and 'value' keys) or a scalar.
443
444Example for 'scalar' option value:
445
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300446.. code-block:: yaml
447
448 linux:
449 system:
450 kernel:
451 module:
452 nf_conntrack:
453 option:
454 hashsize: 262144
455
Dmitry Teselkin809834c2018-08-13 19:14:42 +0300456Example for 'mapping' option value:
457
458.. code-block:: yaml
459
460 linux:
461 system:
462 kernel:
463 module:
464 nf_conntrack:
465 option:
466 hashsize:
467 enabled: true
468 value: 262144
469
470NOTE: 'enabled' key is optional and is True by default.
471
472Blacklist a module:
473
474.. code-block:: yaml
475
476 linux:
477 system:
478 kernel:
479 module:
480 nf_conntrack:
481 blacklist: true
482
483A module can have a number of aliases, wildcards are allowed.
484Define an alias for a module:
485
486.. code-block:: yaml
487
488 linux:
489 system:
490 kernel:
491 module:
492 nf_conntrack:
493 alias:
494 nfct:
495 enabled: true
496 "nf_conn*":
497 enabled: true
498
499NOTE: 'enabled' key is mandatory as there are no other keys exist.
500
501Execute custom command instead of 'insmod' when inserting a module:
502
503.. code-block:: yaml
504
505 linux:
506 system:
507 kernel:
508 module:
509 nf_conntrack:
510 install:
511 enabled: true
512 command: /bin/true
513
514NOTE: 'enabled' key is optional and is True by default.
515
516Execute custom command instead of 'rmmod' when removing a module:
517
518.. code-block:: yaml
519
520 linux:
521 system:
522 kernel:
523 module:
524 nf_conntrack:
525 remove:
526 enabled: true
527 command: /bin/true
528
529NOTE: 'enabled' key is optional and is True by default.
530
531Define module dependencies:
532
533.. code-block:: yaml
534
535 linux:
536 system:
537 kernel:
538 module:
539 nf_conntrack:
540 softdep:
541 pre:
542 1:
543 enabled: true
544 value: a
545 2:
546 enabled: true
547 value: b
548 3:
549 enabled: true
550 value: c
551 post:
552 1:
553 enabled: true
554 value: x
555 2:
556 enabled: true
557 value: y
558 3:
559 enabled: true
560 value: z
561
562NOTE: 'enabled' key is optional and is True by default.
563
564
Filip Pytloun281034a2016-01-04 18:06:22 +0100565Install specific kernel version and ensure all other kernel packages are
566not present. Also install extra modules and headers for this kernel:
567
568.. code-block:: yaml
569
570 linux:
571 system:
572 kernel:
573 type: generic
574 extra: true
575 headers: true
576 version: 4.2.0-22
577
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300578Systcl kernel parameters:
Jakub Pavlik32c2cb02016-01-29 12:45:29 +0100579
580.. code-block:: yaml
581
582 linux:
583 system:
584 kernel:
585 sysctl:
586 net.ipv4.tcp_keepalive_intvl: 3
587 net.ipv4.tcp_keepalive_time: 30
588 net.ipv4.tcp_keepalive_probes: 8
589
Michael Polenchukebf55522018-01-25 13:22:39 +0400590Configure kernel boot options:
591
592.. code-block:: yaml
593
594 linux:
595 system:
596 kernel:
597 boot_options:
598 - elevator=deadline
599 - spectre_v2=off
600 - nopti
601
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100602CPU
603~~~
604
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300605Enable cpufreq governor for every cpu:
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100606
607.. code-block:: yaml
608
609 linux:
610 system:
611 cpu:
612 governor: performance
613
Nick Metzf04f5f32018-01-08 15:25:04 +0100614
Jiri Broulik303905d2018-01-11 14:12:48 +0100615CGROUPS
616~~~~~~~
617
618Setup linux cgroups:
619
620.. code-block:: yaml
621
622 linux:
623 system:
624 cgroup:
625 enabled: true
626 group:
627 ceph_group_1:
628 controller:
629 cpu:
630 shares:
631 value: 250
632 cpuacct:
633 usage:
634 value: 0
635 cpuset:
636 cpus:
637 value: 1,2,3
638 memory:
639 limit_in_bytes:
640 value: 2G
641 memsw.limit_in_bytes:
642 value: 3G
643 mapping:
644 subjects:
645 - '@ceph'
646 generic_group_1:
647 controller:
648 cpu:
649 shares:
650 value: 250
651 cpuacct:
652 usage:
653 value: 0
654 mapping:
655 subjects:
656 - '*:firefox'
657 - 'student:cp'
658
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300659Shared libraries
Nick Metzf04f5f32018-01-08 15:25:04 +0100660~~~~~~~~~~~~~~~~
661
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300662Set additional shared library to Linux system library path:
Nick Metzf04f5f32018-01-08 15:25:04 +0100663
664.. code-block:: yaml
665
666 linux:
667 system:
668 ld:
669 library:
670 java:
671 - /usr/lib/jvm/jre-openjdk/lib/amd64/server
672 - /opt/java/jre/lib/amd64/server
Ondrej Smolaef9bd762018-07-11 14:26:02 +0200673
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200674Certificates
675~~~~~~~~~~~~
676
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300677Add certificate authority into system trusted CA bundle:
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200678
679.. code-block:: yaml
680
681 linux:
682 system:
683 ca_certificates:
684 mycert: |
685 -----BEGIN CERTIFICATE-----
686 MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
687 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
688 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
689 MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
690 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
691 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
692 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
693 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
694 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
695 CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
696 lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
697 AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
698 -----END CERTIFICATE-----
699
Filip Pytloun361096c2017-08-23 10:57:20 +0200700Sysfs
701~~~~~
702
703Install sysfsutils and set sysfs attributes:
704
705.. code-block:: yaml
706
707 linux:
708 system:
709 sysfs:
710 scheduler:
711 block/sda/queue/scheduler: deadline
712 power:
713 mode:
714 power/state: 0660
715 owner:
716 power/state: "root:power"
717 devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
718
Ondrej Smolaef9bd762018-07-11 14:26:02 +0200719Optional: You can also use list that will ensure order of items.
720
721.. code-block:: yaml
722
723 linux:
724 system:
725 sysfs:
726 scheduler:
727 block/sda/queue/scheduler: deadline
728 power:
729 - mode:
730 power/state: 0660
731 - owner:
732 power/state: "root:power"
733 - devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
734
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100735Huge Pages
736~~~~~~~~~~~~
737
738Huge Pages give a performance boost to applications that intensively deal
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300739with memory allocation/deallocation by decreasing memory fragmentation:
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100740
741.. code-block:: yaml
742
743 linux:
744 system:
745 kernel:
746 hugepages:
747 small:
748 size: 2M
749 count: 107520
750 mount_point: /mnt/hugepages_2MB
Michael Polenchukd9369fe2018-05-08 17:53:08 +0400751 mount: false/true # default is true (mount immediately) / false (just save in the fstab)
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100752 large:
753 default: true # default automatically mounted
754 size: 1G
755 count: 210
756 mount_point: /mnt/hugepages_1GB
757
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300758.. note:: Not recommended to use both pagesizes concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100759
Jakub Pavlik5398d872017-02-13 22:30:47 +0100760Intel SR-IOV
761~~~~~~~~~~~~
762
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300763PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV)
764specification defines a standardized mechanism to virtualize
765PCIe devices. The mechanism can virtualize a single PCIe
766Ethernet controller to appear as multiple PCIe devices:
Jakub Pavlik5398d872017-02-13 22:30:47 +0100767
768.. code-block:: yaml
769
770 linux:
771 system:
772 kernel:
773 sriov: True
774 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
775 rc:
776 local: |
777 #!/bin/sh -e
778 # Enable 7 VF on eth1
779 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
780 exit 0
781
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100782Isolate CPU options
783~~~~~~~~~~~~~~~~~~~
784
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300785Remove the specified CPUs, as defined by the cpu_number values, from
786the general kernel SMP balancing and scheduler algroithms. The only
787way to move a process onto or off an *isolated* CPU is via the CPU
788affinity syscalls. ``cpu_number begins`` at ``0``, so the
789maximum value is ``1`` less than the number of CPUs on the system.:
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100790
791.. code-block:: yaml
792
793 linux:
794 system:
795 kernel:
796 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100797
Filip Pytlounf5383a42015-10-06 16:28:32 +0200798Repositories
799~~~~~~~~~~~~
800
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300801RedHat-based Linux with additional OpenStack repo:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200802
803.. code-block:: yaml
804
805 linux:
806 system:
807 ...
808 repo:
809 rdo-icehouse:
810 enabled: true
811 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
812 pgpcheck: 0
813
814Ensure system repository to use czech Debian mirror (``default: true``)
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300815Also pin it's packages with priority ``900``:
Filip Pytlounf5383a42015-10-06 16:28:32 +0200816
817.. code-block:: yaml
818
819 linux:
820 system:
821 repo:
822 debian:
823 default: true
824 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
825 # Import signing key from URL if needed
826 key_url: "http://dummy.com/public.gpg"
827 pin:
828 - pin: 'origin "ftp.cz.debian.org"'
829 priority: 900
830 package: '*'
831
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300832.. note:: For old Ubuntu releases (<xenial)
azvyagintsevff089d22018-07-27 16:52:34 +0200833 extra packages for apt transport, like ``apt-transport-https``
834 may be required to be installed manually.
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300835 (Chicken-eggs issue: we need to install packages to
azvyagintsevff089d22018-07-27 16:52:34 +0200836 reach repo from where they should be installed)
837 Otherwise, you still can try 'fortune' and install prereq.packages before
838 any repo configuration, using list of requires in map.jinja.
839
840
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300841Disabling any prerequisite packages installation:
842
azvyagintsevff089d22018-07-27 16:52:34 +0200843You can simply drop any package pre-installation (before system.linux.repo
844will be processed) via cluster lvl:
845
846.. code-block:: yaml
847
848 linux:
849 system:
850 pkgs: ~
851
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300852Package manager proxy global setup:
Petr Michalec10462bb2017-03-23 19:18:08 +0100853
854.. code-block:: yaml
855
856 linux:
857 system:
858 ...
859 repo:
860 apt-mk:
861 source: "deb http://apt-mk.mirantis.com/ stable main salt"
862 ...
863 proxy:
864 pkg:
865 enabled: true
866 ftp: ftp://ftp-proxy-for-apt.host.local:2121
867 ...
868 # NOTE: Global defaults for any other componet that configure proxy on the system.
869 # If your environment has just one simple proxy, set it on linux:system:proxy.
870 #
871 # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
872 # as for https and http
873 ftp: ftp://proxy.host.local:2121
874 http: http://proxy.host.local:3142
875 https: https://proxy.host.local:3143
876
877Package manager proxy setup per repository:
878
879.. code-block:: yaml
880
881 linux:
882 system:
883 ...
884 repo:
885 debian:
886 source: "deb http://apt-mk.mirantis.com/ stable main salt"
887 ...
888 apt-mk:
889 source: "deb http://apt-mk.mirantis.com/ stable main salt"
890 # per repository proxy
891 proxy:
892 enabled: true
893 http: http://maas-01:8080
894 https: http://maas-01:8080
895 ...
896 proxy:
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600897 # package manager fallback defaults
Petr Michalec10462bb2017-03-23 19:18:08 +0100898 # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
899 pkg:
900 enabled: true
901 ftp: ftp://proxy.host.local:2121
902 #http: http://proxy.host.local:3142
903 #https: https://proxy.host.local:3143
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600904 ...
Petr Michalec10462bb2017-03-23 19:18:08 +0100905 # global system fallback system defaults
906 ftp: ftp://proxy.host.local:2121
907 http: http://proxy.host.local:3142
908 https: https://proxy.host.local:3143
909
Jiri Broulik34a29b42017-04-25 14:42:54 +0200910Remove all repositories:
911
912.. code-block:: yaml
913
914 linux:
915 system:
916 purge_repos: true
917
azvyagintsevff089d22018-07-27 16:52:34 +0200918Refresh repositories metada, after configuration:
919
920.. code-block:: yaml
921
922 linux:
923 system:
924 refresh_repos_meta: true
925
Filip Pytlounc512e6c2017-11-22 14:28:10 +0100926Setup custom apt config options:
927
928.. code-block:: yaml
929
930 linux:
931 system:
932 apt:
933 config:
934 compression-workaround:
935 "Acquire::CompressionTypes::Order": "gz"
936 docker-clean:
937 "DPkg::Post-Invoke":
938 - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
939 "APT::Update::Post-Invoke":
940 - "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 +0200941
Petr Michalec10462bb2017-03-23 19:18:08 +0100942RC
943~~
944
Jakub Pavlik78859382016-01-21 11:26:39 +0100945rc.local example
946
947.. code-block:: yaml
948
949 linux:
950 system:
951 rc:
952 local: |
953 #!/bin/sh -e
954 #
955 # rc.local
956 #
957 # This script is executed at the end of each multiuser runlevel.
958 # Make sure that the script will "exit 0" on success or any other
959 # value on error.
960 #
961 # In order to enable or disable this script just change the execution
962 # bits.
963 #
964 # By default this script does nothing.
965 exit 0
966
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100967Prompt
968~~~~~~
969
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300970Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``.
971Every user can have different prompt:
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100972
973.. code-block:: yaml
974
975 linux:
976 system:
977 prompt:
978 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\\]
979 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
980
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300981On Debian systems, to set prompt system-wide, it's necessary to
982remove setting PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc``,
983which comes from ``/etc/skel/.bashrc``. This formula will do
984this automatically, but will not touch existing user's
985``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +0100986
Filip Pytlouneef11c12016-03-25 11:00:23 +0100987Bash
988~~~~
989
OlgaGusarenko2828f5f2018-07-30 19:37:05 +0300990Fix bash configuration to preserve history across sessions
991like ZSH does by default:
Filip Pytlouneef11c12016-03-25 11:00:23 +0100992
993.. code-block:: yaml
994
995 linux:
996 system:
997 bash:
998 preserve_history: true
999
Dmitry Teselkin949398e2018-05-03 15:50:00 +03001000Login banner message
1001~~~~~~~~~~~~~~~~~~~~
1002
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001003``/etc/issue`` is a text file which contains a message or system
1004identification to be printed before the login prompt. It may contain
Dmitry Teselkin949398e2018-05-03 15:50:00 +03001005various @char and \char sequences, if supported by the getty-type
1006program employed on the system.
1007
1008Setting logon banner message is easy:
1009
1010.. code-block:: yaml
1011
1012 liunx:
1013 system:
1014 banner:
1015 enabled: true
1016 contents: |
1017 UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
1018
1019 You must have explicit, authorized permission to access or configure this
1020 device. Unauthorized attempts and actions to access or use this system may
1021 result in civil and/or criminal penalties.
1022 All activities performed on this system are logged and monitored.
1023
Filip Pytloune874dfb2016-01-22 16:57:34 +01001024Message of the day
1025~~~~~~~~~~~~~~~~~~
1026
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001027``pam_motd`` from package ``libpam-modules`` is used for dynamic
1028messages of the day. Setting custom ``motd`` will clean up existing ones.
Filip Pytloune874dfb2016-01-22 16:57:34 +01001029
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001030Setting static ``motd`` will replace existing ``/etc/motd`` and remove
1031scripts from ``/etc/update-motd.d``.
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001032
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001033Setting static ``motd``:
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001034
1035.. code-block:: yaml
1036
1037 linux:
1038 system:
1039 motd: |
1040 UNAUTHORIZED ACCESS TO THIS SYSTEM IS PROHIBITED
1041
1042 You must have explicit, authorized permission to access or configure this
1043 device. Unauthorized attempts and actions to access or use this system may
1044 result in civil and/or criminal penalties.
1045 All activities performed on this system are logged and monitored.
1046
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001047Setting dynamic ``motd``:
Dmitry Teselkin538c8242018-04-02 16:13:37 +03001048
Filip Pytloune874dfb2016-01-22 16:57:34 +01001049.. code-block:: yaml
1050
1051 linux:
1052 system:
1053 motd:
1054 - release: |
1055 #!/bin/sh
1056 [ -r /etc/lsb-release ] && . /etc/lsb-release
1057
1058 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
1059 # Fall back to using the very slow lsb_release utility
1060 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
1061 fi
1062
1063 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
1064 - warning: |
1065 #!/bin/sh
1066 printf "This is [company name] network.\n"
1067 printf "Unauthorized access strictly prohibited.\n"
1068
Marek Celoud713e9072017-05-18 15:20:25 +02001069Services
1070~~~~~~~~
1071
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001072Stop and disable the ``linux`` service:
Marek Celoud713e9072017-05-18 15:20:25 +02001073
1074.. code-block:: yaml
1075
1076 linux:
1077 system:
1078 service:
1079 apt-daily.timer:
1080 status: dead
1081
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001082Possible statuses are ``dead`` (disable service by default), ``running``
1083(enable service by default), ``enabled``, ``disabled``:
Marek Celoud713e9072017-05-18 15:20:25 +02001084
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001085Linux with the ``atop`` service:
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +03001086
1087.. code-block:: yaml
1088
1089 linux:
1090 system:
1091 atop:
1092 enabled: true
1093 interval: 20
1094 logpath: "/var/log/atop"
1095 outfile: "/var/log/atop/daily.log"
1096
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001097Linux with the ``mcelog`` service:
Oleksii Chupryn144432b2018-05-22 10:34:48 +03001098
1099.. code-block:: yaml
1100
1101 linux:
1102 system:
1103 mcelog:
1104 enabled: true
1105 logging:
1106 syslog: true
1107 syslog_error: true
1108
Filip Pytloun2f70b492016-02-19 15:55:25 +01001109RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +01001110^^^^^^^^^^^^^
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001111Currently, ``update-motd`` is not available
1112for RHEL. So there is no native support for dynamic ``motd``.
1113You can still set a static one, with a different pillar structure:
Filip Pytloun2f70b492016-02-19 15:55:25 +01001114
1115.. code-block:: yaml
1116
1117 linux:
1118 system:
1119 motd: |
1120 This is [company name] network.
1121 Unauthorized access strictly prohibited.
1122
Filip Pytloun8296bb92016-02-19 18:42:09 +01001123Haveged
1124~~~~~~~
1125
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001126If you are running headless server and are low on entropy,
1127you may set up Haveged:
Filip Pytloun8296bb92016-02-19 18:42:09 +01001128
1129.. code-block:: yaml
1130
1131 linux:
1132 system:
1133 haveged:
1134 enabled: true
1135
Filip Pytlounf5383a42015-10-06 16:28:32 +02001136Linux network
1137-------------
1138
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001139Linux with network manager:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001140
1141.. code-block:: yaml
1142
1143 linux:
1144 network:
1145 enabled: true
1146 network_manager: true
1147
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001148Linux with default static network interfaces, default gateway
1149interface and DNS servers:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001150
1151.. code-block:: yaml
1152
1153 linux:
1154 network:
1155 enabled: true
1156 interface:
1157 eth0:
1158 enabled: true
1159 type: eth
1160 address: 192.168.0.102
1161 netmask: 255.255.255.0
1162 gateway: 192.168.0.1
1163 name_servers:
1164 - 8.8.8.8
1165 - 8.8.4.4
1166 mtu: 1500
1167
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001168Linux with bonded interfaces and disabled ``NetworkManager``:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001169
1170.. code-block:: yaml
1171
1172 linux:
1173 network:
1174 enabled: true
1175 interface:
1176 eth0:
1177 type: eth
1178 ...
1179 eth1:
1180 type: eth
1181 ...
1182 bond0:
1183 enabled: true
1184 type: bond
1185 address: 192.168.0.102
1186 netmask: 255.255.255.0
1187 mtu: 1500
1188 use_in:
1189 - interface: ${linux:interface:eth0}
1190 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +01001191 network_manager:
1192 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001193
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001194Linux with VLAN ``interface_params``:
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001195
1196.. code-block:: yaml
1197
1198 linux:
1199 network:
1200 enabled: true
1201 interface:
1202 vlan69:
1203 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +01001204 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001205 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001206
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001207Linux with wireless interface parameters:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001208
1209.. code-block:: yaml
1210
1211 linux:
1212 network:
1213 enabled: true
1214 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001215 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +02001216 interface:
1217 wlan0:
1218 type: eth
1219 wireless:
1220 essid: example
1221 key: example_key
1222 security: wpa
1223 priority: 1
1224
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001225Linux networks with routes defined:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001226
1227.. code-block:: yaml
1228
1229 linux:
1230 network:
1231 enabled: true
1232 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +01001233 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +02001234 interface:
1235 eth0:
1236 type: eth
1237 route:
1238 default:
1239 address: 192.168.0.123
1240 netmask: 255.255.255.0
1241 gateway: 192.168.0.1
1242
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001243Native Linux Bridges:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001244
1245.. code-block:: yaml
1246
1247 linux:
1248 network:
1249 interface:
1250 eth1:
1251 enabled: true
1252 type: eth
1253 proto: manual
1254 up_cmds:
1255 - ip address add 0/0 dev $IFACE
1256 - ip link set $IFACE up
1257 down_cmds:
1258 - ip link set $IFACE down
1259 br-ex:
1260 enabled: true
1261 type: bridge
1262 address: ${linux:network:host:public_local:address}
1263 netmask: 255.255.255.0
1264 use_interfaces:
1265 - eth1
1266
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001267Open vSwitch Bridges:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001268
1269.. code-block:: yaml
1270
1271 linux:
1272 network:
1273 bridge: openvswitch
1274 interface:
1275 eth1:
1276 enabled: true
1277 type: eth
1278 proto: manual
1279 up_cmds:
1280 - ip address add 0/0 dev $IFACE
1281 - ip link set $IFACE up
1282 down_cmds:
1283 - ip link set $IFACE down
1284 br-ex:
1285 enabled: true
1286 type: bridge
1287 address: ${linux:network:host:public_local:address}
1288 netmask: 255.255.255.0
1289 use_interfaces:
1290 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001291 br-prv:
1292 enabled: true
1293 type: ovs_bridge
1294 mtu: 65000
1295 br-ens7:
1296 enabled: true
1297 name: br-ens7
1298 type: ovs_bridge
1299 proto: manual
1300 mtu: 9000
1301 use_interfaces:
1302 - ens7
1303 patch-br-ens7-br-prv:
1304 enabled: true
1305 name: ens7-prv
1306 ovs_type: ovs_port
1307 type: ovs_port
1308 bridge: br-ens7
1309 port_type: patch
1310 peer: prv-ens7
Oleksii Chupryn694ee722018-06-13 14:08:58 +03001311 tag: 109 # [] to unset a tag
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001312 mtu: 65000
1313 patch-br-prv-br-ens7:
1314 enabled: true
1315 name: prv-ens7
1316 bridge: br-prv
1317 ovs_type: ovs_port
1318 type: ovs_port
1319 port_type: patch
1320 peer: ens7-prv
Oleksii Chupryn694ee722018-06-13 14:08:58 +03001321 tag: 109
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +03001322 mtu: 65000
1323 ens7:
1324 enabled: true
1325 name: ens7
1326 proto: manual
1327 ovs_port_type: OVSPort
1328 type: ovs_port
1329 ovs_bridge: br-ens7
1330 bridge: br-ens7
Filip Pytlounf5383a42015-10-06 16:28:32 +02001331
Petr Jediný8f8ae542017-07-13 16:19:12 +02001332Debian manual proto interfaces
1333
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001334When you are changing interface proto from static in up state
1335to manual, you may need to flush ip addresses. For example,
1336if you want to use the interface and the ip on the bridge.
1337This can be done by setting the ``ipflush_onchange`` to true.
Petr Jediný8f8ae542017-07-13 16:19:12 +02001338
1339.. code-block:: yaml
1340
1341 linux:
1342 network:
1343 interface:
1344 eth1:
1345 enabled: true
1346 type: eth
1347 proto: manual
1348 mtu: 9100
1349 ipflush_onchange: true
1350
Jiri Broulik1a191e32018-01-15 15:54:21 +01001351Debian static proto interfaces
1352
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001353When you are changing interface proto from dhcp in up state to
1354static, you may need to flush ip addresses and restart interface
1355to assign ip address from a managed file. For example, if you wantto
1356use the interface and the ip on the bridge. This can be done by
1357setting the ``ipflush_onchange`` with combination ``restart_on_ipflush``
1358param set to true.
Jiri Broulik1a191e32018-01-15 15:54:21 +01001359
1360.. code-block:: yaml
1361
1362 linux:
1363 network:
1364 interface:
1365 eth1:
1366 enabled: true
1367 type: eth
1368 proto: static
1369 address: 10.1.0.22
1370 netmask: 255.255.255.0
1371 ipflush_onchange: true
1372 restart_on_ipflush: true
Petr Jediný8f8ae542017-07-13 16:19:12 +02001373
Petr Jedinýd577cb52017-06-28 20:17:49 +02001374Concatinating and removing interface files
1375
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001376Debian based distributions have ``/etc/network/interfaces.d/``
1377directory, where you can store configuration of network
1378interfaces in separate files. You can concatinate the files
1379to the defined destination when needed, this operation removes
1380the file from the ``/etc/network/interfaces.d/``. If you just need
1381to remove iface files, you can use the ``remove_iface_files`` key.
Petr Jedinýd577cb52017-06-28 20:17:49 +02001382
1383.. code-block:: yaml
1384
1385 linux:
1386 network:
1387 concat_iface_files:
1388 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
1389 dst: '/etc/network/interfaces'
1390 remove_iface_files:
1391 - '/etc/network/interfaces.d/90-custom.cfg'
1392
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001393Configure DHCP client
Petr Jedinýd577cb52017-06-28 20:17:49 +02001394
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001395None of the keys is mandatory, include only those you really need.
1396For full list of available options under send, supersede, prepend,
1397append refer to dhcp-options(5).
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001398
1399.. code-block:: yaml
1400
1401 linux:
1402 network:
1403 dhclient:
1404 enabled: true
1405 backoff_cutoff: 15
1406 initial_interval: 10
1407 reboot: 10
1408 retry: 60
1409 select_timeout: 0
1410 timeout: 120
1411 send:
1412 - option: host-name
1413 declaration: "= gethostname()"
1414 supersede:
1415 - option: host-name
1416 declaration: "spaceship"
1417 - option: domain-name
1418 declaration: "domain.home"
1419 #- option: arp-cache-timeout
1420 # declaration: 20
1421 prepend:
1422 - option: domain-name-servers
1423 declaration:
1424 - 8.8.8.8
1425 - 8.8.4.4
1426 - option: domain-search
1427 declaration:
1428 - example.com
1429 - eng.example.com
1430 #append:
1431 #- option: domain-name-servers
1432 # declaration: 127.0.0.1
1433 # ip or subnet to reject dhcp offer from
1434 reject:
1435 - 192.33.137.209
1436 - 10.0.2.0/24
1437 request:
1438 - subnet-mask
1439 - broadcast-address
1440 - time-offset
1441 - routers
1442 - domain-name
1443 - domain-name-servers
1444 - domain-search
1445 - host-name
1446 - dhcp6.name-servers
1447 - dhcp6.domain-search
1448 - dhcp6.fqdn
1449 - dhcp6.sntp-servers
1450 - netbios-name-servers
1451 - netbios-scope
1452 - interface-mtu
1453 - rfc3442-classless-static-routes
1454 - ntp-servers
1455 require:
1456 - subnet-mask
1457 - domain-name-servers
1458 # if per interface configuration required add below
1459 interface:
1460 ens2:
1461 initial_interval: 11
1462 reject:
1463 - 192.33.137.210
1464 ens3:
1465 initial_interval: 12
1466 reject:
1467 - 192.33.137.211
1468
Petr Michaleceb14b552017-06-01 10:27:05 +02001469Linux network systemd settings:
1470
1471.. code-block:: yaml
1472
1473 linux:
1474 network:
1475 ...
1476 systemd:
1477 link:
1478 10-iface-dmz:
1479 Match:
1480 MACAddress: c8:5b:67:fa:1a:af
1481 OriginalName: eth0
1482 Link:
1483 Name: dmz0
1484 netdev:
1485 20-bridge-dmz:
1486 match:
1487 name: dmz0
1488 network:
1489 mescription: bridge
1490 bridge: br-dmz0
1491 network:
1492 # works with lowercase, keys are by default capitalized
1493 40-dhcp:
1494 match:
1495 name: '*'
1496 network:
1497 DHCP: yes
1498
Petr Michalec10462bb2017-03-23 19:18:08 +01001499Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001500
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001501Use ``/etc/environment`` for static system wide variable assignment
1502after boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001503
1504.. code-block:: yaml
1505
1506 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001507 system:
1508 env:
1509 BOB_VARIABLE: Alice
1510 ...
1511 BOB_PATH:
1512 - /srv/alice/bin
1513 - /srv/bob/bin
1514 ...
1515 ftp_proxy: none
1516 http_proxy: http://global-http-proxy.host.local:8080
1517 https_proxy: ${linux:system:proxy:https}
1518 no_proxy:
1519 - 192.168.0.80
1520 - 192.168.1.80
1521 - .domain.com
1522 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001523 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001524 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001525 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001526 ftp: ftp://proxy.host.local:2121
1527 http: http://proxy.host.local:3142
1528 https: https://proxy.host.local:3143
1529 noproxy:
1530 - .domain.com
1531 - .local
1532
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001533Configure the ``profile.d`` scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001534
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001535The ``profile.d`` scripts are being sourced during ``.sh`` execution
1536and support variable expansion in opposite to /etc/environment global
1537settings in ``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001538
1539.. code-block:: yaml
1540
1541 linux:
1542 system:
1543 profile:
1544 locales: |
1545 export LANG=C
1546 export LC_ALL=C
1547 ...
1548 vi_flavors.sh: |
1549 export PAGER=view
1550 export EDITOR=vim
1551 alias vi=vim
1552 shell_locales.sh: |
1553 export LANG=en_US
1554 export LC_ALL=en_US.UTF-8
1555 shell_proxies.sh: |
1556 export FTP_PROXY=ftp://127.0.3.3:2121
1557 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001558
1559Linux with hosts
1560
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001561Parameter ``purge_hosts`` will enforce whole ``/etc/hosts file``,
1562removing entries that are not defined in model except defaults
1563for both IPv4 and IPv6 localhost and hostname as well as FQDN.
Ales Komarek417e8c52017-08-25 15:10:29 +02001564
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001565We recommend using this option to verify that ``/etc/hosts``
1566is always in a clean state. However it is not enabled by default
1567for security reasons.
Filip Pytloun86506fe2017-01-26 14:36:16 +01001568
Filip Pytlounf5383a42015-10-06 16:28:32 +02001569.. code-block:: yaml
1570
1571 linux:
1572 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001573 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001574 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001575 # No need to define this one if purge_hosts is true
1576 hostname:
1577 address: 127.0.1.1
1578 names:
1579 - ${linux:network:fqdn}
1580 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02001581 node1:
1582 address: 192.168.10.200
1583 names:
1584 - node2.domain.com
1585 - service2.domain.com
1586 node2:
1587 address: 192.168.10.201
1588 names:
1589 - node2.domain.com
1590 - service2.domain.com
1591
Ales Komarek417e8c52017-08-25 15:10:29 +02001592Linux with hosts collected from mine
1593
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001594All DNS records defined within infrastrucuture
1595are passed to the local hosts records or any DNS server. Only
1596hosts with the ``grain`` parameter set to ``true`` will be propagated
1597to the mine.
Ales Komarek417e8c52017-08-25 15:10:29 +02001598
1599.. code-block:: yaml
1600
1601 linux:
1602 network:
1603 purge_hosts: true
1604 mine_dns_records: true
1605 host:
1606 node1:
1607 address: 192.168.10.200
1608 grain: true
1609 names:
1610 - node2.domain.com
1611 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01001612
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001613Set up ``resolv.conf``, nameservers, domain and search domains:
Filip Pytlounde9bea52016-01-11 15:39:10 +01001614
1615.. code-block:: yaml
1616
1617 linux:
1618 network:
1619 resolv:
1620 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001621 - 8.8.4.4
1622 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01001623 domain: my.example.com
1624 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001625 - my.example.com
1626 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01001627 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001628 - ndots: 5
1629 - timeout: 2
1630 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +01001631
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001632Set up custom TX queue length for tap interfaces:
Andrii Petrenko735761d2017-03-21 17:17:35 -07001633
1634.. code-block:: yaml
1635
1636 linux:
1637 network:
1638 tap_custom_txqueuelen: 10000
1639
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001640DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001641
1642**DPDK OVS NIC**
1643
1644.. code-block:: yaml
1645
1646 linux:
1647 network:
1648 bridge: openvswitch
1649 dpdk:
1650 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001651 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001652 openvswitch:
1653 pmd_cpu_mask: "0x6"
1654 dpdk_socket_mem: "1024,1024"
1655 dpdk_lcore_mask: "0x400"
1656 memory_channels: 2
1657 interface:
1658 dpkd0:
1659 name: ${_param:dpdk_nic}
1660 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001661 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001662 enabled: true
1663 type: dpdk_ovs_port
1664 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001665 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001666 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01001667 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001668 br-prv:
1669 enabled: true
1670 type: dpdk_ovs_bridge
1671
1672**DPDK OVS Bond**
1673
1674.. code-block:: yaml
1675
1676 linux:
1677 network:
1678 bridge: openvswitch
1679 dpdk:
1680 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001681 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001682 openvswitch:
1683 pmd_cpu_mask: "0x6"
1684 dpdk_socket_mem: "1024,1024"
1685 dpdk_lcore_mask: "0x400"
1686 memory_channels: 2
1687 interface:
1688 dpdk_second_nic:
1689 name: ${_param:primary_second_nic}
1690 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001691 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001692 bond: dpdkbond0
1693 enabled: true
1694 type: dpdk_ovs_port
1695 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001696 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001697 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001698 dpdk_first_nic:
1699 name: ${_param:primary_first_nic}
1700 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001701 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001702 bond: dpdkbond0
1703 enabled: true
1704 type: dpdk_ovs_port
1705 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001706 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001707 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001708 dpdkbond0:
1709 enabled: true
1710 bridge: br-prv
1711 type: dpdk_ovs_bond
1712 mode: active-backup
1713 br-prv:
1714 enabled: true
1715 type: dpdk_ovs_bridge
1716
Dzmitry Stremkouskif619b072018-03-15 20:13:42 +01001717**DPDK OVS LACP Bond with vlan tag**
1718
1719.. code-block:: yaml
1720
1721 linux:
1722 network:
1723 bridge: openvswitch
1724 dpdk:
1725 enabled: true
1726 driver: uio
1727 openvswitch:
1728 pmd_cpu_mask: "0x6"
1729 dpdk_socket_mem: "1024,1024"
1730 dpdk_lcore_mask: "0x400"
1731 memory_channels: "2"
1732 interface:
1733 eth3:
1734 enabled: true
1735 type: eth
1736 proto: manual
1737 name: ${_param:tenant_first_nic}
1738 eth4:
1739 enabled: true
1740 type: eth
1741 proto: manual
1742 name: ${_param:tenant_second_nic}
1743 dpdk0:
1744 name: ${_param:tenant_first_nic}
1745 pci: "0000:81:00.0"
1746 driver: igb_uio
1747 bond: bond1
1748 enabled: true
1749 type: dpdk_ovs_port
1750 n_rxq: 2
1751 dpdk1:
1752 name: ${_param:tenant_second_nic}
1753 pci: "0000:81:00.1"
1754 driver: igb_uio
1755 bond: bond1
1756 enabled: true
1757 type: dpdk_ovs_port
1758 n_rxq: 2
1759 bond1:
1760 enabled: true
1761 bridge: br-prv
1762 type: dpdk_ovs_bond
1763 mode: balance-slb
1764 br-prv:
1765 enabled: true
1766 type: dpdk_ovs_bridge
1767 tag: ${_param:tenant_vlan}
1768 address: ${_param:tenant_address}
1769 netmask: ${_param:tenant_network_netmask}
1770
Jakub Pavlikaa759062017-03-13 15:57:26 +01001771**DPDK OVS bridge for VXLAN**
1772
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001773If VXLAN is used as tenant segmentation, IP address must
1774be set on ``br-prv``.
Jakub Pavlikaa759062017-03-13 15:57:26 +01001775
1776.. code-block:: yaml
1777
1778 linux:
1779 network:
1780 ...
1781 interface:
1782 br-prv:
1783 enabled: true
1784 type: dpdk_ovs_bridge
1785 address: 192.168.50.0
1786 netmask: 255.255.255.0
Michael Polenchukd173d552018-01-22 15:22:47 +04001787 tag: 101
Jakub Pavlikaa759062017-03-13 15:57:26 +01001788 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001789
Oleksii Chupryne2151ff2018-03-13 16:01:12 +02001790**DPDK OVS bridge with Linux network interface**
1791
1792.. code-block:: yaml
1793
1794 linux:
1795 network:
1796 ...
1797 interface:
1798 eth0:
1799 type: eth
1800 ovs_bridge: br-prv
1801 ...
1802 br-prv:
1803 enabled: true
1804 type: dpdk_ovs_bridge
1805 ...
1806
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001807Linux storage
1808-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02001809
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001810Linux with mounted Samba:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001811
1812.. code-block:: yaml
1813
1814 linux:
1815 storage:
1816 enabled: true
1817 mount:
1818 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01001819 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001820 - path: /media/myuser/public/
1821 - device: //192.168.0.1/storage
1822 - file_system: cifs
1823 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
1824
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001825NFS mount:
Jiri Broulikb017f932017-03-31 13:55:36 +02001826
1827.. code-block:: yaml
1828
1829 linux:
1830 storage:
1831 enabled: true
1832 mount:
1833 nfs_glance:
1834 enabled: true
1835 path: /var/lib/glance/images
1836 device: 172.16.10.110:/var/nfs/glance
1837 file_system: nfs
1838 opts: rw,sync
1839
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001840File swap configuration:
Filip Pytlounf5383a42015-10-06 16:28:32 +02001841
1842.. code-block:: yaml
1843
1844 linux:
1845 storage:
1846 enabled: true
1847 swap:
1848 file:
1849 enabled: true
1850 engine: file
1851 device: /swapfile
1852 size: 1024
1853
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001854Partition swap configuration:
Lachlan Evenson30676512016-01-22 15:43:28 -08001855
1856.. code-block:: yaml
1857
1858 linux:
1859 storage:
1860 enabled: true
1861 swap:
1862 partition:
1863 enabled: true
1864 engine: partition
1865 device: /dev/vg0/swap
1866
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001867LVM group ``vg1`` with one device and ``data`` volume mounted
1868into ``/mnt/data``.
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001869
1870.. code-block:: yaml
1871
1872 parameters:
1873 linux:
1874 storage:
1875 mount:
1876 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01001877 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001878 device: /dev/vg1/data
1879 file_system: ext4
1880 path: /mnt/data
1881 lvm:
1882 vg1:
1883 enabled: true
1884 devices:
1885 - /dev/sdb
1886 volume:
1887 data:
1888 size: 40G
1889 mount: ${linux:storage:mount:data}
1890
Jakub Pavlik4f742142017-08-08 15:05:50 +02001891Create partitions on disk. Specify size in MB. It expects empty
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001892disk without any existing partitions.
1893Set ``startsector=1`` if you want to start partitions from ``2048``.
Jakub Pavlik4f742142017-08-08 15:05:50 +02001894
1895.. code-block:: yaml
1896
1897 linux:
1898 storage:
1899 disk:
1900 first_drive:
Piotr Krukd51911b2017-12-04 11:27:08 +01001901 startsector: 1
Jakub Pavlik4f742142017-08-08 15:05:50 +02001902 name: /dev/loop1
1903 type: gpt
1904 partitions:
1905 - size: 200 #size in MB
1906 type: fat32
1907 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02001908 mkfs: True
1909 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02001910 /dev/vda1:
1911 partitions:
1912 - size: 5
1913 type: ext2
1914 - size: 10
1915 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02001916
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001917Multipath with Fujitsu Eternus DXL:
Ales Komareka634f4b2016-10-02 13:11:04 +02001918
1919.. code-block:: yaml
1920
1921 parameters:
1922 linux:
1923 storage:
1924 multipath:
1925 enabled: true
1926 blacklist_devices:
1927 - /dev/sda
1928 - /dev/sdb
1929 backends:
1930 - fujitsu_eternus_dxl
1931
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001932Multipath with Hitachi VSP 1000:
Ales Komareka634f4b2016-10-02 13:11:04 +02001933
1934.. code-block:: yaml
1935
1936 parameters:
1937 linux:
1938 storage:
1939 multipath:
1940 enabled: true
1941 blacklist_devices:
1942 - /dev/sda
1943 - /dev/sdb
1944 backends:
1945 - hitachi_vsp1000
1946
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001947Multipath with IBM Storwize:
Ales Komareka634f4b2016-10-02 13:11:04 +02001948
1949.. code-block:: yaml
1950
1951 parameters:
1952 linux:
1953 storage:
1954 multipath:
1955 enabled: true
1956 blacklist_devices:
1957 - /dev/sda
1958 - /dev/sdb
1959 backends:
1960 - ibm_storwize
1961
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001962Multipath with multiple backends:
Ales Komareka634f4b2016-10-02 13:11:04 +02001963
1964.. code-block:: yaml
1965
1966 parameters:
1967 linux:
1968 storage:
1969 multipath:
1970 enabled: true
1971 blacklist_devices:
1972 - /dev/sda
1973 - /dev/sdb
1974 - /dev/sdc
1975 - /dev/sdd
1976 backends:
1977 - ibm_storwize
1978 - fujitsu_eternus_dxl
1979 - hitachi_vsp1000
1980
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03001981PAM LDAP integration:
Dmitry Stremkouski7d8d67a2017-11-15 13:08:19 +03001982
1983.. code-block:: yaml
1984
1985 parameters:
1986 linux:
1987 system:
1988 auth:
1989 enabled: true
Dzmitry Stremkouski602735d2018-05-09 22:31:39 +02001990 mkhomedir:
1991 enabled: true
1992 umask: 0027
Dmitry Stremkouski7d8d67a2017-11-15 13:08:19 +03001993 ldap:
1994 enabled: true
1995 binddn: cn=bind,ou=service_users,dc=example,dc=com
1996 bindpw: secret
1997 uri: ldap://127.0.0.1
1998 base: ou=users,dc=example,dc=com
1999 ldap_version: 3
2000 pagesize: 65536
2001 referrals: off
2002 filter:
2003 passwd: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
2004 shadow: (&(&(objectClass=person)(uidNumber=*))(unixHomeDirectory=*))
2005 group: (&(objectClass=group)(gidNumber=*))
2006
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002007Disabled multipath (the default setup):
Ales Komareka634f4b2016-10-02 13:11:04 +02002008
2009.. code-block:: yaml
2010
2011 parameters:
2012 linux:
2013 storage:
2014 multipath:
2015 enabled: false
2016
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002017Linux with local loopback device:
Simon Pasquier375001e2017-01-26 13:22:33 +01002018
2019.. code-block:: yaml
2020
2021 linux:
2022 storage:
2023 loopback:
2024 disk1:
2025 file: /srv/disk1
2026 size: 50G
2027
Filip Pytlounb2c8f852016-11-21 17:03:43 +01002028External config generation
2029--------------------------
2030
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002031You are able to use config support metadata between formulas
2032and only generate configuration files for external use, for example, Docker, and so on.
Filip Pytlounb2c8f852016-11-21 17:03:43 +01002033
2034.. code-block:: yaml
2035
2036 parameters:
2037 linux:
2038 system:
2039 config:
2040 pillar:
2041 jenkins:
2042 master:
2043 home: /srv/volumes/jenkins
2044 approved_scripts:
2045 - method java.net.URL openConnection
2046 credentials:
2047 - type: username_password
2048 scope: global
2049 id: test
2050 desc: Testing credentials
2051 username: test
2052 password: test
2053
Vladimir Ereminccf28842017-04-10 23:52:10 +03002054Netconsole Remote Kernel Logging
2055--------------------------------
2056
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002057Netconsole logger can be configured for the configfs-enabled kernels
2058(``CONFIG_NETCONSOLE_DYNAMIC`` must be enabled). The configuration
2059applies both in runtime (if network is already configured),
2060and on-boot after an interface initialization.
Vladimir Ereminccf28842017-04-10 23:52:10 +03002061
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002062.. note::
2063
2064 * Receiver can be located only on the same L3 domain
2065 (or you need to configure gateway MAC manually).
2066 * The Receiver MAC is detected only on configuration time.
2067 * Using broadcast MAC is not recommended.
Vladimir Ereminccf28842017-04-10 23:52:10 +03002068
2069.. code-block:: yaml
2070
2071 parameters:
2072 linux:
2073 system:
2074 netconsole:
2075 enabled: true
2076 port: 514 (optional)
2077 loglevel: debug (optional)
2078 target:
2079 192.168.0.1:
2080 interface: bond0
2081 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02002082
Filip Pytlounf5383a42015-10-06 16:28:32 +02002083Usage
2084=====
2085
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002086Set MTU of the eth0 network interface to 1400:
Filip Pytlounf5383a42015-10-06 16:28:32 +02002087
2088.. code-block:: bash
2089
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002090 ip link set dev eth0 mtu 1400
Filip Pytlounf5383a42015-10-06 16:28:32 +02002091
2092Read more
2093=========
2094
2095* https://www.archlinux.org/
2096* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01002097
2098Documentation and Bugs
2099======================
2100
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002101* http://salt-formulas.readthedocs.io/
2102 Learn how to install and update salt-formulas.
Filip Pytloun018f8712017-02-02 13:02:03 +01002103
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002104* https://github.com/salt-formulas/salt-formula-linux/issues
2105 In the unfortunate event that bugs are discovered, report the issue to the
2106 appropriate issue tracker. Use the Github issue tracker for a specific salt
2107 formula.
Filip Pytloun018f8712017-02-02 13:02:03 +01002108
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002109* https://launchpad.net/salt-formulas
2110 For feature requests, bug reports, or blueprints affecting the entire
2111 ecosystem, use the Launchpad salt-formulas project.
Filip Pytloun018f8712017-02-02 13:02:03 +01002112
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002113* https://launchpad.net/~salt-formulas-users
2114 Join the salt-formulas-users team and subscribe to mailing list if required.
Filip Pytloun018f8712017-02-02 13:02:03 +01002115
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002116* https://github.com/salt-formulas/salt-formula-linux
2117 Develop the salt-formulas projects in the master branch and then submit pull
2118 requests against a specific formula.
Filip Pytloun018f8712017-02-02 13:02:03 +01002119
OlgaGusarenko2828f5f2018-07-30 19:37:05 +03002120* #salt-formulas @ irc.freenode.net
2121 Use this IRC channel in case of any questions or feedback which is always
2122 welcome.
Filip Pytloun018f8712017-02-02 13:02:03 +01002123