blob: a4d5323655c47d44911c41a1d2c07dc88fd128f8 [file] [log] [blame]
Aleš Komárek63572992017-04-11 13:16:44 +02001============
2Linux Fomula
3============
Filip Pytlounf5383a42015-10-06 16:28:32 +02004
5Linux Operating Systems.
6
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 +020016
17Linux System
Filip Pytlounf5383a42015-10-06 16:28:32 +020018------------
19
20Basic Linux box
21
22.. code-block:: yaml
23
24 linux:
25 system:
26 enabled: true
27 name: 'node1'
28 domain: 'domain.com'
29 cluster: 'system'
30 environment: prod
31 timezone: 'Europe/Prague'
32 utc: true
33
azvyagintsev967af132017-06-12 12:25:24 +030034Linux with system users, some with password set:
35.. WARNING::
36If no 'password' variable has been passed - any predifined password
37will be removed.
Filip Pytlounf5383a42015-10-06 16:28:32 +020038
39.. code-block:: yaml
40
41 linux:
42 system:
43 ...
44 user:
45 jdoe:
46 name: 'jdoe'
47 enabled: true
48 sudo: true
49 shell: /bin/bash
50 full_name: 'Jonh Doe'
51 home: '/home/jdoe'
52 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
Filip Pytlounf5383a42015-10-06 16:28:32 +0200184Linux with package, latest version
185
186.. code-block:: yaml
187
188 linux:
189 system:
190 ...
191 package:
192 package-name:
193 version: latest
194
195Linux with package from certail repo, version with no upgrades
196
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
208Linux with package from certail repo, version with no GPG verification
209
210.. code-block:: yaml
211
212 linux:
213 system:
214 ...
215 package:
216 package-name:
217 version: 2132.323
218 repo: 'custom-repo'
219 verify: false
220
Bruno Binet69a9d8d2017-02-16 22:34:32 +0100221Linux with autoupdates (automatically install security package updates)
222
223.. code-block:: yaml
224
225 linux:
226 system:
227 ...
228 autoupdates:
229 enabled: true
230 mail: root@localhost
231 mail_only_on_error: true
232 remove_unused_dependencies: false
233 automatic_reboot: true
234 automatic_reboot_time: "02:00"
235
Filip Pytlounf5383a42015-10-06 16:28:32 +0200236Linux with cron jobs
Filip Pytloun91222222017-08-04 10:55:27 +0200237By default it will use name as an identifier, unless identifier key is
238explicitly set or False (then it will use Salt's default behavior which is
239identifier same as command resulting in not being able to change it)
Filip Pytlounf5383a42015-10-06 16:28:32 +0200240
241.. code-block:: yaml
242
243 linux:
244 system:
245 ...
246 job:
247 cmd1:
248 command: '/cmd/to/run'
Filip Pytloun91222222017-08-04 10:55:27 +0200249 identifier: cmd1
Filip Pytlounf5383a42015-10-06 16:28:32 +0200250 enabled: true
251 user: 'root'
252 hour: 2
253 minute: 0
254
Filip Pytlound0a29e72015-11-30 15:23:34 +0100255Linux security limits (limit sensu user memory usage to max 1GB):
256
257.. code-block:: yaml
258
259 linux:
260 system:
261 ...
262 limit:
263 sensu:
264 enabled: true
265 domain: sensu
266 limits:
267 - type: hard
268 item: as
269 value: 1000000
270
Filip Pytloun7fee0542015-10-15 11:19:24 +0200271Enable autologin on tty1 (may work only for Ubuntu 14.04):
272
273.. code-block:: yaml
274
275 linux:
276 system:
277 console:
278 tty1:
279 autologin: root
Filip Pytloun281d0202016-01-29 14:03:51 +0100280 # Enable serial console
281 ttyS0:
282 autologin: root
283 rate: 115200
284 term: xterm
Filip Pytloun7fee0542015-10-15 11:19:24 +0200285
286To disable set autologin to `false`.
287
Filip Pytloun7731b852016-02-01 11:13:47 +0100288Set ``policy-rc.d`` on Debian-based systems. Action can be any available
289command in ``while true`` loop and ``case`` context.
290Following will disallow dpkg to stop/start services for cassandra package automatically:
291
292.. code-block:: yaml
293
294 linux:
295 system:
296 policyrcd:
297 - package: cassandra
298 action: exit 101
299 - package: '*'
300 action: switch
301
Filip Pytlounc49445a2016-04-04 14:23:20 +0200302Set system locales:
303
304.. code-block:: yaml
305
306 linux:
307 system:
308 locale:
309 en_US.UTF-8:
310 default: true
Filip Pytlounee1745f2016-04-04 17:39:41 +0200311 "cs_CZ.UTF-8 UTF-8":
Filip Pytlounc49445a2016-04-04 14:23:20 +0200312 enabled: true
313
Andrey Shestakove7cca052017-05-24 23:06:24 +0300314Systemd settings:
315
316.. code-block:: yaml
317
318 linux:
319 system:
320 ...
321 systemd:
322 system:
323 Manager:
324 DefaultLimitNOFILE: 307200
325 DefaultLimitNPROC: 307200
326 user:
327 Manager:
328 DefaultLimitCPU: 2
329 DefaultLimitNPROC: 4
330
Filip Pytloun281034a2016-01-04 18:06:22 +0100331Kernel
332~~~~~~
333
334Install always up to date LTS kernel and headers from Ubuntu trusty:
335
336.. code-block:: yaml
337
338 linux:
339 system:
340 kernel:
341 type: generic
342 lts: trusty
343 headers: true
344
Tomáš Kukrálba35b212017-02-15 17:59:46 +0100345Load kernel modules and add them to `/etc/modules`:
346
347.. code-block:: yaml
348
349 linux:
350 system:
351 kernel:
352 modules:
353 - nf_conntrack
354 - tp_smapi
355 - 8021q
356
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300357Configure or blacklist kernel modules with additional options to `/etc/modprobe.d` following example
358will add `/etc/modprobe.d/nf_conntrack.conf` file with line `options nf_conntrack hashsize=262144`:
359
360.. code-block:: yaml
361
362 linux:
363 system:
364 kernel:
365 module:
366 nf_conntrack:
367 option:
368 hashsize: 262144
369
370
371
Filip Pytloun281034a2016-01-04 18:06:22 +0100372Install specific kernel version and ensure all other kernel packages are
373not present. Also install extra modules and headers for this kernel:
374
375.. code-block:: yaml
376
377 linux:
378 system:
379 kernel:
380 type: generic
381 extra: true
382 headers: true
383 version: 4.2.0-22
384
Jakub Pavlik32c2cb02016-01-29 12:45:29 +0100385Systcl kernel parameters
386
387.. code-block:: yaml
388
389 linux:
390 system:
391 kernel:
392 sysctl:
393 net.ipv4.tcp_keepalive_intvl: 3
394 net.ipv4.tcp_keepalive_time: 30
395 net.ipv4.tcp_keepalive_probes: 8
396
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100397
398CPU
399~~~
400
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300401Enable cpufreq governor for every cpu:
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100402
403.. code-block:: yaml
404
405 linux:
406 system:
407 cpu:
408 governor: performance
409
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200410Certificates
411~~~~~~~~~~~~
412
413Add certificate authority into system trusted CA bundle
414
415.. code-block:: yaml
416
417 linux:
418 system:
419 ca_certificates:
420 mycert: |
421 -----BEGIN CERTIFICATE-----
422 MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
423 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
424 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
425 MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
426 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
427 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
428 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
429 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
430 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
431 CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
432 lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
433 AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
434 -----END CERTIFICATE-----
435
Filip Pytloun361096c2017-08-23 10:57:20 +0200436Sysfs
437~~~~~
438
439Install sysfsutils and set sysfs attributes:
440
441.. code-block:: yaml
442
443 linux:
444 system:
445 sysfs:
446 scheduler:
447 block/sda/queue/scheduler: deadline
448 power:
449 mode:
450 power/state: 0660
451 owner:
452 power/state: "root:power"
453 devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
454
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100455Huge Pages
456~~~~~~~~~~~~
457
458Huge Pages give a performance boost to applications that intensively deal
459with memory allocation/deallocation by decreasing memory fragmentation.
460
461.. code-block:: yaml
462
463 linux:
464 system:
465 kernel:
466 hugepages:
467 small:
468 size: 2M
469 count: 107520
470 mount_point: /mnt/hugepages_2MB
471 mount: false/true # default false
472 large:
473 default: true # default automatically mounted
474 size: 1G
475 count: 210
476 mount_point: /mnt/hugepages_1GB
477
478Note: not recommended to use both pagesizes in concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100479
Jakub Pavlik5398d872017-02-13 22:30:47 +0100480Intel SR-IOV
481~~~~~~~~~~~~
482
483PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV) specification defines a standardized mechanism to virtualize PCIe devices. The mechanism can virtualize a single PCIe Ethernet controller to appear as multiple PCIe devices.
484
485.. code-block:: yaml
486
487 linux:
488 system:
489 kernel:
490 sriov: True
491 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
492 rc:
493 local: |
494 #!/bin/sh -e
495 # Enable 7 VF on eth1
496 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
497 exit 0
498
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100499Isolate CPU options
500~~~~~~~~~~~~~~~~~~~
501
502Remove the specified CPUs, as defined by the cpu_number values, from the general kernel
503SMP balancing and scheduler algroithms. The only way to move a process onto or off an
504"isolated" CPU is via the CPU affinity syscalls. cpu_number begins at 0, so the
505maximum value is 1 less than the number of CPUs on the system.
506
507.. code-block:: yaml
508
509 linux:
510 system:
511 kernel:
512 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100513
Filip Pytlounf5383a42015-10-06 16:28:32 +0200514Repositories
515~~~~~~~~~~~~
516
517RedHat based Linux with additional OpenStack repo
518
519.. code-block:: yaml
520
521 linux:
522 system:
523 ...
524 repo:
525 rdo-icehouse:
526 enabled: true
527 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
528 pgpcheck: 0
529
530Ensure system repository to use czech Debian mirror (``default: true``)
531Also pin it's packages with priority 900.
532
533.. code-block:: yaml
534
535 linux:
536 system:
537 repo:
538 debian:
539 default: true
540 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
541 # Import signing key from URL if needed
542 key_url: "http://dummy.com/public.gpg"
543 pin:
544 - pin: 'origin "ftp.cz.debian.org"'
545 priority: 900
546 package: '*'
547
Petr Michalec10462bb2017-03-23 19:18:08 +0100548
549Package manager proxy setup globally:
550
551.. code-block:: yaml
552
553 linux:
554 system:
555 ...
556 repo:
557 apt-mk:
558 source: "deb http://apt-mk.mirantis.com/ stable main salt"
559 ...
560 proxy:
561 pkg:
562 enabled: true
563 ftp: ftp://ftp-proxy-for-apt.host.local:2121
564 ...
565 # NOTE: Global defaults for any other componet that configure proxy on the system.
566 # If your environment has just one simple proxy, set it on linux:system:proxy.
567 #
568 # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
569 # as for https and http
570 ftp: ftp://proxy.host.local:2121
571 http: http://proxy.host.local:3142
572 https: https://proxy.host.local:3143
573
574Package manager proxy setup per repository:
575
576.. code-block:: yaml
577
578 linux:
579 system:
580 ...
581 repo:
582 debian:
583 source: "deb http://apt-mk.mirantis.com/ stable main salt"
584 ...
585 apt-mk:
586 source: "deb http://apt-mk.mirantis.com/ stable main salt"
587 # per repository proxy
588 proxy:
589 enabled: true
590 http: http://maas-01:8080
591 https: http://maas-01:8080
592 ...
593 proxy:
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600594 # package manager fallback defaults
Petr Michalec10462bb2017-03-23 19:18:08 +0100595 # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
596 pkg:
597 enabled: true
598 ftp: ftp://proxy.host.local:2121
599 #http: http://proxy.host.local:3142
600 #https: https://proxy.host.local:3143
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600601 ...
Petr Michalec10462bb2017-03-23 19:18:08 +0100602 # global system fallback system defaults
603 ftp: ftp://proxy.host.local:2121
604 http: http://proxy.host.local:3142
605 https: https://proxy.host.local:3143
606
607
Jiri Broulik34a29b42017-04-25 14:42:54 +0200608Remove all repositories:
609
610.. code-block:: yaml
611
612 linux:
613 system:
614 purge_repos: true
615
616
Petr Michalec10462bb2017-03-23 19:18:08 +0100617RC
618~~
619
Jakub Pavlik78859382016-01-21 11:26:39 +0100620rc.local example
621
622.. code-block:: yaml
623
624 linux:
625 system:
626 rc:
627 local: |
628 #!/bin/sh -e
629 #
630 # rc.local
631 #
632 # This script is executed at the end of each multiuser runlevel.
633 # Make sure that the script will "exit 0" on success or any other
634 # value on error.
635 #
636 # In order to enable or disable this script just change the execution
637 # bits.
638 #
639 # By default this script does nothing.
640 exit 0
641
Petr Michalec10462bb2017-03-23 19:18:08 +0100642
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100643Prompt
644~~~~~~
645
646Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
647user can have different prompt.
648
649.. code-block:: yaml
650
651 linux:
652 system:
653 prompt:
654 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\\]
655 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
656
657On Debian systems to set prompt system-wide it's necessary to remove setting
658PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
659``/etc/skel/.bashrc``). This formula will do this automatically, but will not
Filip Pytlound9b68da2016-01-22 15:58:41 +0100660touch existing user's ``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +0100661
Filip Pytlouneef11c12016-03-25 11:00:23 +0100662Bash
663~~~~
664
665Fix bash configuration to preserve history across sessions (like ZSH does by
666default).
667
668.. code-block:: yaml
669
670 linux:
671 system:
672 bash:
673 preserve_history: true
674
Filip Pytloune874dfb2016-01-22 16:57:34 +0100675Message of the day
676~~~~~~~~~~~~~~~~~~
677
678``pam_motd`` from package ``update-motd`` is used for dynamic messages of the
679day. Setting custom motd will cleanup existing ones.
680
681.. code-block:: yaml
682
683 linux:
684 system:
685 motd:
686 - release: |
687 #!/bin/sh
688 [ -r /etc/lsb-release ] && . /etc/lsb-release
689
690 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
691 # Fall back to using the very slow lsb_release utility
692 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
693 fi
694
695 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
696 - warning: |
697 #!/bin/sh
698 printf "This is [company name] network.\n"
699 printf "Unauthorized access strictly prohibited.\n"
700
Marek Celoud713e9072017-05-18 15:20:25 +0200701Services
702~~~~~~~~
703
704Stop and disable linux service:
705
706.. code-block:: yaml
707
708 linux:
709 system:
710 service:
711 apt-daily.timer:
712 status: dead
713
714Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
715
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +0300716Linux with atop service:
717
718.. code-block:: yaml
719
720 linux:
721 system:
722 atop:
723 enabled: true
724 interval: 20
725 logpath: "/var/log/atop"
726 outfile: "/var/log/atop/daily.log"
727
Filip Pytloun2f70b492016-02-19 15:55:25 +0100728RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +0100729^^^^^^^^^^^^^
Filip Pytloun2f70b492016-02-19 15:55:25 +0100730
731Unfortunately ``update-motd`` is currently not available for RHEL so there's
732no native support for dynamic motd.
733You can still set static one, only pillar structure differs:
734
735.. code-block:: yaml
736
737 linux:
738 system:
739 motd: |
740 This is [company name] network.
741 Unauthorized access strictly prohibited.
742
Filip Pytloun8296bb92016-02-19 18:42:09 +0100743Haveged
744~~~~~~~
745
746If you are running headless server and are low on entropy, it may be a good
747idea to setup Haveged.
748
749.. code-block:: yaml
750
751 linux:
752 system:
753 haveged:
754 enabled: true
755
Filip Pytlounf5383a42015-10-06 16:28:32 +0200756Linux network
757-------------
758
759Linux with network manager
760
761.. code-block:: yaml
762
763 linux:
764 network:
765 enabled: true
766 network_manager: true
767
768Linux with default static network interfaces, default gateway interface and DNS servers
769
770.. code-block:: yaml
771
772 linux:
773 network:
774 enabled: true
775 interface:
776 eth0:
777 enabled: true
778 type: eth
779 address: 192.168.0.102
780 netmask: 255.255.255.0
781 gateway: 192.168.0.1
782 name_servers:
783 - 8.8.8.8
784 - 8.8.4.4
785 mtu: 1500
786
jan kaufman6d30adf2016-01-18 17:30:12 +0100787Linux with bonded interfaces and disabled NetworkManager
Filip Pytlounf5383a42015-10-06 16:28:32 +0200788
789.. code-block:: yaml
790
791 linux:
792 network:
793 enabled: true
794 interface:
795 eth0:
796 type: eth
797 ...
798 eth1:
799 type: eth
800 ...
801 bond0:
802 enabled: true
803 type: bond
804 address: 192.168.0.102
805 netmask: 255.255.255.0
806 mtu: 1500
807 use_in:
808 - interface: ${linux:interface:eth0}
809 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +0100810 network_manager:
811 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200812
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100813Linux with vlan interface_params
814
815.. code-block:: yaml
816
817 linux:
818 network:
819 enabled: true
820 interface:
821 vlan69:
822 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +0100823 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100824 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100825
Filip Pytlounf5383a42015-10-06 16:28:32 +0200826Linux with wireless interface parameters
827
828.. code-block:: yaml
829
830 linux:
831 network:
832 enabled: true
833 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100834 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200835 interface:
836 wlan0:
837 type: eth
838 wireless:
839 essid: example
840 key: example_key
841 security: wpa
842 priority: 1
843
844Linux networks with routes defined
845
846.. code-block:: yaml
847
848 linux:
849 network:
850 enabled: true
851 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100852 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200853 interface:
854 eth0:
855 type: eth
856 route:
857 default:
858 address: 192.168.0.123
859 netmask: 255.255.255.0
860 gateway: 192.168.0.1
861
862Native Linux Bridges
863
864.. code-block:: yaml
865
866 linux:
867 network:
868 interface:
869 eth1:
870 enabled: true
871 type: eth
872 proto: manual
873 up_cmds:
874 - ip address add 0/0 dev $IFACE
875 - ip link set $IFACE up
876 down_cmds:
877 - ip link set $IFACE down
878 br-ex:
879 enabled: true
880 type: bridge
881 address: ${linux:network:host:public_local:address}
882 netmask: 255.255.255.0
883 use_interfaces:
884 - eth1
885
886OpenVswitch Bridges
887
888.. code-block:: yaml
889
890 linux:
891 network:
892 bridge: openvswitch
893 interface:
894 eth1:
895 enabled: true
896 type: eth
897 proto: manual
898 up_cmds:
899 - ip address add 0/0 dev $IFACE
900 - ip link set $IFACE up
901 down_cmds:
902 - ip link set $IFACE down
903 br-ex:
904 enabled: true
905 type: bridge
906 address: ${linux:network:host:public_local:address}
907 netmask: 255.255.255.0
908 use_interfaces:
909 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +0300910 br-prv:
911 enabled: true
912 type: ovs_bridge
913 mtu: 65000
914 br-ens7:
915 enabled: true
916 name: br-ens7
917 type: ovs_bridge
918 proto: manual
919 mtu: 9000
920 use_interfaces:
921 - ens7
922 patch-br-ens7-br-prv:
923 enabled: true
924 name: ens7-prv
925 ovs_type: ovs_port
926 type: ovs_port
927 bridge: br-ens7
928 port_type: patch
929 peer: prv-ens7
930 mtu: 65000
931 patch-br-prv-br-ens7:
932 enabled: true
933 name: prv-ens7
934 bridge: br-prv
935 ovs_type: ovs_port
936 type: ovs_port
937 port_type: patch
938 peer: ens7-prv
939 mtu: 65000
940 ens7:
941 enabled: true
942 name: ens7
943 proto: manual
944 ovs_port_type: OVSPort
945 type: ovs_port
946 ovs_bridge: br-ens7
947 bridge: br-ens7
Filip Pytlounf5383a42015-10-06 16:28:32 +0200948
Petr Jediný8f8ae542017-07-13 16:19:12 +0200949Debian manual proto interfaces
950
951When you are changing interface proto from static in up state to manual, you
952may need to flush ip addresses. For example, if you want to use the interface
953and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
954to true.
955
956.. code-block:: yaml
957
958 linux:
959 network:
960 interface:
961 eth1:
962 enabled: true
963 type: eth
964 proto: manual
965 mtu: 9100
966 ipflush_onchange: true
967
968
Petr Jedinýd577cb52017-06-28 20:17:49 +0200969Concatinating and removing interface files
970
971Debian based distributions have `/etc/network/interfaces.d/` directory, where
972you can store configuration of network interfaces in separate files. You can
973concatinate the files to the defined destination when needed, this operation
974removes the file from the `/etc/network/interfaces.d/`. If you just need to
975remove iface files, you can use the `remove_iface_files` key.
976
977.. code-block:: yaml
978
979 linux:
980 network:
981 concat_iface_files:
982 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
983 dst: '/etc/network/interfaces'
984 remove_iface_files:
985 - '/etc/network/interfaces.d/90-custom.cfg'
986
987
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600988DHCP client configuration
989
990None of the keys is mandatory, include only those you really need. For full list
991of available options under send, supersede, prepend, append refer to dhcp-options(5)
992
993.. code-block:: yaml
994
995 linux:
996 network:
997 dhclient:
998 enabled: true
999 backoff_cutoff: 15
1000 initial_interval: 10
1001 reboot: 10
1002 retry: 60
1003 select_timeout: 0
1004 timeout: 120
1005 send:
1006 - option: host-name
1007 declaration: "= gethostname()"
1008 supersede:
1009 - option: host-name
1010 declaration: "spaceship"
1011 - option: domain-name
1012 declaration: "domain.home"
1013 #- option: arp-cache-timeout
1014 # declaration: 20
1015 prepend:
1016 - option: domain-name-servers
1017 declaration:
1018 - 8.8.8.8
1019 - 8.8.4.4
1020 - option: domain-search
1021 declaration:
1022 - example.com
1023 - eng.example.com
1024 #append:
1025 #- option: domain-name-servers
1026 # declaration: 127.0.0.1
1027 # ip or subnet to reject dhcp offer from
1028 reject:
1029 - 192.33.137.209
1030 - 10.0.2.0/24
1031 request:
1032 - subnet-mask
1033 - broadcast-address
1034 - time-offset
1035 - routers
1036 - domain-name
1037 - domain-name-servers
1038 - domain-search
1039 - host-name
1040 - dhcp6.name-servers
1041 - dhcp6.domain-search
1042 - dhcp6.fqdn
1043 - dhcp6.sntp-servers
1044 - netbios-name-servers
1045 - netbios-scope
1046 - interface-mtu
1047 - rfc3442-classless-static-routes
1048 - ntp-servers
1049 require:
1050 - subnet-mask
1051 - domain-name-servers
1052 # if per interface configuration required add below
1053 interface:
1054 ens2:
1055 initial_interval: 11
1056 reject:
1057 - 192.33.137.210
1058 ens3:
1059 initial_interval: 12
1060 reject:
1061 - 192.33.137.211
1062
Petr Michaleceb14b552017-06-01 10:27:05 +02001063Linux network systemd settings:
1064
1065.. code-block:: yaml
1066
1067 linux:
1068 network:
1069 ...
1070 systemd:
1071 link:
1072 10-iface-dmz:
1073 Match:
1074 MACAddress: c8:5b:67:fa:1a:af
1075 OriginalName: eth0
1076 Link:
1077 Name: dmz0
1078 netdev:
1079 20-bridge-dmz:
1080 match:
1081 name: dmz0
1082 network:
1083 mescription: bridge
1084 bridge: br-dmz0
1085 network:
1086 # works with lowercase, keys are by default capitalized
1087 40-dhcp:
1088 match:
1089 name: '*'
1090 network:
1091 DHCP: yes
1092
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001093
Petr Michalec10462bb2017-03-23 19:18:08 +01001094Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001095
Ales Komarek417e8c52017-08-25 15:10:29 +02001096Use ``/etc/environment`` for static system wide variable assignment after
1097boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001098
1099.. code-block:: yaml
1100
1101 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001102 system:
1103 env:
1104 BOB_VARIABLE: Alice
1105 ...
1106 BOB_PATH:
1107 - /srv/alice/bin
1108 - /srv/bob/bin
1109 ...
1110 ftp_proxy: none
1111 http_proxy: http://global-http-proxy.host.local:8080
1112 https_proxy: ${linux:system:proxy:https}
1113 no_proxy:
1114 - 192.168.0.80
1115 - 192.168.1.80
1116 - .domain.com
1117 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001118 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001119 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001120 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001121 ftp: ftp://proxy.host.local:2121
1122 http: http://proxy.host.local:3142
1123 https: https://proxy.host.local:3143
1124 noproxy:
1125 - .domain.com
1126 - .local
1127
1128Configure profile.d scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001129
Ales Komarek417e8c52017-08-25 15:10:29 +02001130The profile.d scripts are being sourced during .sh execution and support
1131variable expansion in opposite to /etc/environment global settings in
1132``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001133
1134.. code-block:: yaml
1135
1136 linux:
1137 system:
1138 profile:
1139 locales: |
1140 export LANG=C
1141 export LC_ALL=C
1142 ...
1143 vi_flavors.sh: |
1144 export PAGER=view
1145 export EDITOR=vim
1146 alias vi=vim
1147 shell_locales.sh: |
1148 export LANG=en_US
1149 export LC_ALL=en_US.UTF-8
1150 shell_proxies.sh: |
1151 export FTP_PROXY=ftp://127.0.3.3:2121
1152 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001153
1154Linux with hosts
1155
Filip Pytloun86506fe2017-01-26 14:36:16 +01001156Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
1157that are not defined in model except defaults for both IPv4 and IPv6 localhost
1158and hostname + fqdn.
Ales Komarek417e8c52017-08-25 15:10:29 +02001159
Filip Pytloun86506fe2017-01-26 14:36:16 +01001160It's good to use this option if you want to ensure /etc/hosts is always in a
1161clean state however it's not enabled by default for safety.
1162
Filip Pytlounf5383a42015-10-06 16:28:32 +02001163.. code-block:: yaml
1164
1165 linux:
1166 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001167 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001168 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001169 # No need to define this one if purge_hosts is true
1170 hostname:
1171 address: 127.0.1.1
1172 names:
1173 - ${linux:network:fqdn}
1174 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02001175 node1:
1176 address: 192.168.10.200
1177 names:
1178 - node2.domain.com
1179 - service2.domain.com
1180 node2:
1181 address: 192.168.10.201
1182 names:
1183 - node2.domain.com
1184 - service2.domain.com
1185
Ales Komarek417e8c52017-08-25 15:10:29 +02001186Linux with hosts collected from mine
1187
1188In this case all dns records defined within infrastrucuture will be passed to
1189local hosts records or any DNS server. Only hosts with `grain` parameter to
1190true will be propagated to the mine.
1191
1192.. code-block:: yaml
1193
1194 linux:
1195 network:
1196 purge_hosts: true
1197 mine_dns_records: true
1198 host:
1199 node1:
1200 address: 192.168.10.200
1201 grain: true
1202 names:
1203 - node2.domain.com
1204 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01001205
Filip Pytlounde9bea52016-01-11 15:39:10 +01001206Setup resolv.conf, nameservers, domain and search domains
1207
1208.. code-block:: yaml
1209
1210 linux:
1211 network:
1212 resolv:
1213 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001214 - 8.8.4.4
1215 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01001216 domain: my.example.com
1217 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001218 - my.example.com
1219 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01001220 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001221 - ndots: 5
1222 - timeout: 2
1223 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +01001224
Ales Komarek417e8c52017-08-25 15:10:29 +02001225setting custom TX queue length for tap interfaces
Andrii Petrenko735761d2017-03-21 17:17:35 -07001226
1227.. code-block:: yaml
1228
1229 linux:
1230 network:
1231 tap_custom_txqueuelen: 10000
1232
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001233DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001234
1235**DPDK OVS NIC**
1236
1237.. code-block:: yaml
1238
1239 linux:
1240 network:
1241 bridge: openvswitch
1242 dpdk:
1243 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001244 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001245 openvswitch:
1246 pmd_cpu_mask: "0x6"
1247 dpdk_socket_mem: "1024,1024"
1248 dpdk_lcore_mask: "0x400"
1249 memory_channels: 2
1250 interface:
1251 dpkd0:
1252 name: ${_param:dpdk_nic}
1253 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001254 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001255 enabled: true
1256 type: dpdk_ovs_port
1257 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001258 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001259 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01001260 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001261 br-prv:
1262 enabled: true
1263 type: dpdk_ovs_bridge
1264
1265**DPDK OVS Bond**
1266
1267.. code-block:: yaml
1268
1269 linux:
1270 network:
1271 bridge: openvswitch
1272 dpdk:
1273 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001274 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001275 openvswitch:
1276 pmd_cpu_mask: "0x6"
1277 dpdk_socket_mem: "1024,1024"
1278 dpdk_lcore_mask: "0x400"
1279 memory_channels: 2
1280 interface:
1281 dpdk_second_nic:
1282 name: ${_param:primary_second_nic}
1283 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001284 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001285 bond: dpdkbond0
1286 enabled: true
1287 type: dpdk_ovs_port
1288 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001289 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001290 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001291 dpdk_first_nic:
1292 name: ${_param:primary_first_nic}
1293 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001294 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001295 bond: dpdkbond0
1296 enabled: true
1297 type: dpdk_ovs_port
1298 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001299 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001300 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001301 dpdkbond0:
1302 enabled: true
1303 bridge: br-prv
1304 type: dpdk_ovs_bond
1305 mode: active-backup
1306 br-prv:
1307 enabled: true
1308 type: dpdk_ovs_bridge
1309
Jakub Pavlikaa759062017-03-13 15:57:26 +01001310**DPDK OVS bridge for VXLAN**
1311
1312If VXLAN is used as tenant segmentation then ip address must be set on br-prv
1313
1314.. code-block:: yaml
1315
1316 linux:
1317 network:
1318 ...
1319 interface:
1320 br-prv:
1321 enabled: true
1322 type: dpdk_ovs_bridge
1323 address: 192.168.50.0
1324 netmask: 255.255.255.0
1325 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001326
1327Linux storage
1328-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02001329
1330Linux with mounted Samba
1331
1332.. code-block:: yaml
1333
1334 linux:
1335 storage:
1336 enabled: true
1337 mount:
1338 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01001339 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001340 - path: /media/myuser/public/
1341 - device: //192.168.0.1/storage
1342 - file_system: cifs
1343 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
1344
Jiri Broulikb017f932017-03-31 13:55:36 +02001345NFS mount
1346
1347.. code-block:: yaml
1348
1349 linux:
1350 storage:
1351 enabled: true
1352 mount:
1353 nfs_glance:
1354 enabled: true
1355 path: /var/lib/glance/images
1356 device: 172.16.10.110:/var/nfs/glance
1357 file_system: nfs
1358 opts: rw,sync
1359
1360
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001361File swap configuration
Filip Pytlounf5383a42015-10-06 16:28:32 +02001362
1363.. code-block:: yaml
1364
1365 linux:
1366 storage:
1367 enabled: true
1368 swap:
1369 file:
1370 enabled: true
1371 engine: file
1372 device: /swapfile
1373 size: 1024
1374
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001375Partition swap configuration
Lachlan Evenson30676512016-01-22 15:43:28 -08001376
1377.. code-block:: yaml
1378
1379 linux:
1380 storage:
1381 enabled: true
1382 swap:
1383 partition:
1384 enabled: true
1385 engine: partition
1386 device: /dev/vg0/swap
1387
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001388LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
1389
1390.. code-block:: yaml
1391
1392 parameters:
1393 linux:
1394 storage:
1395 mount:
1396 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01001397 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001398 device: /dev/vg1/data
1399 file_system: ext4
1400 path: /mnt/data
1401 lvm:
1402 vg1:
1403 enabled: true
1404 devices:
1405 - /dev/sdb
1406 volume:
1407 data:
1408 size: 40G
1409 mount: ${linux:storage:mount:data}
1410
Jakub Pavlik4f742142017-08-08 15:05:50 +02001411Create partitions on disk. Specify size in MB. It expects empty
1412disk without any existing partitions.
1413
1414.. code-block:: yaml
1415
1416 linux:
1417 storage:
1418 disk:
1419 first_drive:
1420 name: /dev/loop1
1421 type: gpt
1422 partitions:
1423 - size: 200 #size in MB
1424 type: fat32
1425 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02001426 mkfs: True
1427 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02001428 /dev/vda1:
1429 partitions:
1430 - size: 5
1431 type: ext2
1432 - size: 10
1433 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02001434
1435Multipath with Fujitsu Eternus DXL
1436
1437.. code-block:: yaml
1438
1439 parameters:
1440 linux:
1441 storage:
1442 multipath:
1443 enabled: true
1444 blacklist_devices:
1445 - /dev/sda
1446 - /dev/sdb
1447 backends:
1448 - fujitsu_eternus_dxl
1449
1450Multipath with Hitachi VSP 1000
1451
1452.. code-block:: yaml
1453
1454 parameters:
1455 linux:
1456 storage:
1457 multipath:
1458 enabled: true
1459 blacklist_devices:
1460 - /dev/sda
1461 - /dev/sdb
1462 backends:
1463 - hitachi_vsp1000
1464
1465Multipath with IBM Storwize
1466
1467.. code-block:: yaml
1468
1469 parameters:
1470 linux:
1471 storage:
1472 multipath:
1473 enabled: true
1474 blacklist_devices:
1475 - /dev/sda
1476 - /dev/sdb
1477 backends:
1478 - ibm_storwize
1479
1480Multipath with multiple backends
1481
1482.. code-block:: yaml
1483
1484 parameters:
1485 linux:
1486 storage:
1487 multipath:
1488 enabled: true
1489 blacklist_devices:
1490 - /dev/sda
1491 - /dev/sdb
1492 - /dev/sdc
1493 - /dev/sdd
1494 backends:
1495 - ibm_storwize
1496 - fujitsu_eternus_dxl
1497 - hitachi_vsp1000
1498
1499Disabled multipath (the default setup)
1500
1501.. code-block:: yaml
1502
1503 parameters:
1504 linux:
1505 storage:
1506 multipath:
1507 enabled: false
1508
Simon Pasquier375001e2017-01-26 13:22:33 +01001509Linux with local loopback device
1510
1511.. code-block:: yaml
1512
1513 linux:
1514 storage:
1515 loopback:
1516 disk1:
1517 file: /srv/disk1
1518 size: 50G
1519
Filip Pytlounb2c8f852016-11-21 17:03:43 +01001520External config generation
1521--------------------------
1522
1523You are able to use config support metadata between formulas and only generate
1524config files for external use, eg. docker, etc.
1525
1526.. code-block:: yaml
1527
1528 parameters:
1529 linux:
1530 system:
1531 config:
1532 pillar:
1533 jenkins:
1534 master:
1535 home: /srv/volumes/jenkins
1536 approved_scripts:
1537 - method java.net.URL openConnection
1538 credentials:
1539 - type: username_password
1540 scope: global
1541 id: test
1542 desc: Testing credentials
1543 username: test
1544 password: test
1545
Vladimir Ereminccf28842017-04-10 23:52:10 +03001546Netconsole Remote Kernel Logging
1547--------------------------------
1548
1549Netconsole logger could be configured for configfs-enabled kernels
1550(`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
1551runtime (if network is already configured), and on-boot after interface
1552initialization. Notes:
1553
1554 * receiver could be located only in same L3 domain
1555 (or you need to configure gateway MAC manually)
1556 * receiver's MAC is detected only on configuration time
1557 * using broadcast MAC is not recommended
1558
1559.. code-block:: yaml
1560
1561 parameters:
1562 linux:
1563 system:
1564 netconsole:
1565 enabled: true
1566 port: 514 (optional)
1567 loglevel: debug (optional)
1568 target:
1569 192.168.0.1:
1570 interface: bond0
1571 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02001572
Filip Pytlounf5383a42015-10-06 16:28:32 +02001573Usage
1574=====
1575
1576Set mtu of network interface eth0 to 1400
1577
1578.. code-block:: bash
1579
1580 ip link set dev eth0 mtu 1400
1581
1582Read more
1583=========
1584
1585* https://www.archlinux.org/
1586* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01001587
1588Documentation and Bugs
1589======================
1590
1591To learn how to install and update salt-formulas, consult the documentation
1592available online at:
1593
1594 http://salt-formulas.readthedocs.io/
1595
1596In the unfortunate event that bugs are discovered, they should be reported to
1597the appropriate issue tracker. Use Github issue tracker for specific salt
1598formula:
1599
1600 https://github.com/salt-formulas/salt-formula-linux/issues
1601
1602For feature requests, bug reports or blueprints affecting entire ecosystem,
1603use Launchpad salt-formulas project:
1604
1605 https://launchpad.net/salt-formulas
1606
1607You can also join salt-formulas-users team and subscribe to mailing list:
1608
1609 https://launchpad.net/~salt-formulas-users
1610
1611Developers wishing to work on the salt-formulas projects should always base
1612their work on master branch and submit pull request against specific formula.
1613
1614 https://github.com/salt-formulas/salt-formula-linux
1615
1616Any questions or feedback is always welcome so feel free to join our IRC
1617channel:
1618
1619 #salt-formulas @ irc.freenode.net