blob: 1cbc18c75e94be3d2b026277c2ab7133a1218353 [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 Pytloun8b2131e2017-11-08 13:29:03 +0100331Ensure presence of directory:
332
333.. code-block:: yaml
334
335 linux:
336 system:
337 directory:
338 /tmp/test:
339 user: root
340 group: root
341 mode: 700
342 makedirs: true
343
Filip Pytloun281034a2016-01-04 18:06:22 +0100344Kernel
345~~~~~~
346
347Install always up to date LTS kernel and headers from Ubuntu trusty:
348
349.. code-block:: yaml
350
351 linux:
352 system:
353 kernel:
354 type: generic
355 lts: trusty
356 headers: true
357
Tomáš Kukrálba35b212017-02-15 17:59:46 +0100358Load kernel modules and add them to `/etc/modules`:
359
360.. code-block:: yaml
361
362 linux:
363 system:
364 kernel:
365 modules:
366 - nf_conntrack
367 - tp_smapi
368 - 8021q
369
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300370Configure or blacklist kernel modules with additional options to `/etc/modprobe.d` following example
371will add `/etc/modprobe.d/nf_conntrack.conf` file with line `options nf_conntrack hashsize=262144`:
372
373.. code-block:: yaml
374
375 linux:
376 system:
377 kernel:
378 module:
379 nf_conntrack:
380 option:
381 hashsize: 262144
382
383
384
Filip Pytloun281034a2016-01-04 18:06:22 +0100385Install specific kernel version and ensure all other kernel packages are
386not present. Also install extra modules and headers for this kernel:
387
388.. code-block:: yaml
389
390 linux:
391 system:
392 kernel:
393 type: generic
394 extra: true
395 headers: true
396 version: 4.2.0-22
397
Jakub Pavlik32c2cb02016-01-29 12:45:29 +0100398Systcl kernel parameters
399
400.. code-block:: yaml
401
402 linux:
403 system:
404 kernel:
405 sysctl:
406 net.ipv4.tcp_keepalive_intvl: 3
407 net.ipv4.tcp_keepalive_time: 30
408 net.ipv4.tcp_keepalive_probes: 8
409
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100410
411CPU
412~~~
413
teoyaomiqui32b1f7c2017-05-24 14:36:09 +0300414Enable cpufreq governor for every cpu:
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100415
416.. code-block:: yaml
417
418 linux:
419 system:
420 cpu:
421 governor: performance
422
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200423Certificates
424~~~~~~~~~~~~
425
426Add certificate authority into system trusted CA bundle
427
428.. code-block:: yaml
429
430 linux:
431 system:
432 ca_certificates:
433 mycert: |
434 -----BEGIN CERTIFICATE-----
435 MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
436 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
437 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
438 MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
439 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
440 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
441 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
442 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
443 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
444 CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
445 lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
446 AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
447 -----END CERTIFICATE-----
448
Filip Pytloun361096c2017-08-23 10:57:20 +0200449Sysfs
450~~~~~
451
452Install sysfsutils and set sysfs attributes:
453
454.. code-block:: yaml
455
456 linux:
457 system:
458 sysfs:
459 scheduler:
460 block/sda/queue/scheduler: deadline
461 power:
462 mode:
463 power/state: 0660
464 owner:
465 power/state: "root:power"
466 devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
467
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100468Huge Pages
469~~~~~~~~~~~~
470
471Huge Pages give a performance boost to applications that intensively deal
472with memory allocation/deallocation by decreasing memory fragmentation.
473
474.. code-block:: yaml
475
476 linux:
477 system:
478 kernel:
479 hugepages:
480 small:
481 size: 2M
482 count: 107520
483 mount_point: /mnt/hugepages_2MB
484 mount: false/true # default false
485 large:
486 default: true # default automatically mounted
487 size: 1G
488 count: 210
489 mount_point: /mnt/hugepages_1GB
490
491Note: not recommended to use both pagesizes in concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100492
Jakub Pavlik5398d872017-02-13 22:30:47 +0100493Intel SR-IOV
494~~~~~~~~~~~~
495
496PCI-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.
497
498.. code-block:: yaml
499
500 linux:
501 system:
502 kernel:
503 sriov: True
504 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
505 rc:
506 local: |
507 #!/bin/sh -e
508 # Enable 7 VF on eth1
509 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
510 exit 0
511
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100512Isolate CPU options
513~~~~~~~~~~~~~~~~~~~
514
515Remove the specified CPUs, as defined by the cpu_number values, from the general kernel
516SMP balancing and scheduler algroithms. The only way to move a process onto or off an
517"isolated" CPU is via the CPU affinity syscalls. cpu_number begins at 0, so the
518maximum value is 1 less than the number of CPUs on the system.
519
520.. code-block:: yaml
521
522 linux:
523 system:
524 kernel:
525 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100526
Filip Pytlounf5383a42015-10-06 16:28:32 +0200527Repositories
528~~~~~~~~~~~~
529
530RedHat based Linux with additional OpenStack repo
531
532.. code-block:: yaml
533
534 linux:
535 system:
536 ...
537 repo:
538 rdo-icehouse:
539 enabled: true
540 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
541 pgpcheck: 0
542
543Ensure system repository to use czech Debian mirror (``default: true``)
544Also pin it's packages with priority 900.
545
546.. code-block:: yaml
547
548 linux:
549 system:
550 repo:
551 debian:
552 default: true
553 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
554 # Import signing key from URL if needed
555 key_url: "http://dummy.com/public.gpg"
556 pin:
557 - pin: 'origin "ftp.cz.debian.org"'
558 priority: 900
559 package: '*'
560
Petr Michalec10462bb2017-03-23 19:18:08 +0100561
562Package manager proxy setup globally:
563
564.. code-block:: yaml
565
566 linux:
567 system:
568 ...
569 repo:
570 apt-mk:
571 source: "deb http://apt-mk.mirantis.com/ stable main salt"
572 ...
573 proxy:
574 pkg:
575 enabled: true
576 ftp: ftp://ftp-proxy-for-apt.host.local:2121
577 ...
578 # NOTE: Global defaults for any other componet that configure proxy on the system.
579 # If your environment has just one simple proxy, set it on linux:system:proxy.
580 #
581 # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
582 # as for https and http
583 ftp: ftp://proxy.host.local:2121
584 http: http://proxy.host.local:3142
585 https: https://proxy.host.local:3143
586
587Package manager proxy setup per repository:
588
589.. code-block:: yaml
590
591 linux:
592 system:
593 ...
594 repo:
595 debian:
596 source: "deb http://apt-mk.mirantis.com/ stable main salt"
597 ...
598 apt-mk:
599 source: "deb http://apt-mk.mirantis.com/ stable main salt"
600 # per repository proxy
601 proxy:
602 enabled: true
603 http: http://maas-01:8080
604 https: http://maas-01:8080
605 ...
606 proxy:
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600607 # package manager fallback defaults
Petr Michalec10462bb2017-03-23 19:18:08 +0100608 # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
609 pkg:
610 enabled: true
611 ftp: ftp://proxy.host.local:2121
612 #http: http://proxy.host.local:3142
613 #https: https://proxy.host.local:3143
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600614 ...
Petr Michalec10462bb2017-03-23 19:18:08 +0100615 # global system fallback system defaults
616 ftp: ftp://proxy.host.local:2121
617 http: http://proxy.host.local:3142
618 https: https://proxy.host.local:3143
619
620
Jiri Broulik34a29b42017-04-25 14:42:54 +0200621Remove all repositories:
622
623.. code-block:: yaml
624
625 linux:
626 system:
627 purge_repos: true
628
629
Petr Michalec10462bb2017-03-23 19:18:08 +0100630RC
631~~
632
Jakub Pavlik78859382016-01-21 11:26:39 +0100633rc.local example
634
635.. code-block:: yaml
636
637 linux:
638 system:
639 rc:
640 local: |
641 #!/bin/sh -e
642 #
643 # rc.local
644 #
645 # This script is executed at the end of each multiuser runlevel.
646 # Make sure that the script will "exit 0" on success or any other
647 # value on error.
648 #
649 # In order to enable or disable this script just change the execution
650 # bits.
651 #
652 # By default this script does nothing.
653 exit 0
654
Petr Michalec10462bb2017-03-23 19:18:08 +0100655
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100656Prompt
657~~~~~~
658
659Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
660user can have different prompt.
661
662.. code-block:: yaml
663
664 linux:
665 system:
666 prompt:
667 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\\]
668 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
669
670On Debian systems to set prompt system-wide it's necessary to remove setting
671PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
672``/etc/skel/.bashrc``). This formula will do this automatically, but will not
Filip Pytlound9b68da2016-01-22 15:58:41 +0100673touch existing user's ``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +0100674
Filip Pytlouneef11c12016-03-25 11:00:23 +0100675Bash
676~~~~
677
678Fix bash configuration to preserve history across sessions (like ZSH does by
679default).
680
681.. code-block:: yaml
682
683 linux:
684 system:
685 bash:
686 preserve_history: true
687
Filip Pytloune874dfb2016-01-22 16:57:34 +0100688Message of the day
689~~~~~~~~~~~~~~~~~~
690
691``pam_motd`` from package ``update-motd`` is used for dynamic messages of the
692day. Setting custom motd will cleanup existing ones.
693
694.. code-block:: yaml
695
696 linux:
697 system:
698 motd:
699 - release: |
700 #!/bin/sh
701 [ -r /etc/lsb-release ] && . /etc/lsb-release
702
703 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
704 # Fall back to using the very slow lsb_release utility
705 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
706 fi
707
708 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
709 - warning: |
710 #!/bin/sh
711 printf "This is [company name] network.\n"
712 printf "Unauthorized access strictly prohibited.\n"
713
Marek Celoud713e9072017-05-18 15:20:25 +0200714Services
715~~~~~~~~
716
717Stop and disable linux service:
718
719.. code-block:: yaml
720
721 linux:
722 system:
723 service:
724 apt-daily.timer:
725 status: dead
726
727Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
728
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +0300729Linux with atop service:
730
731.. code-block:: yaml
732
733 linux:
734 system:
735 atop:
736 enabled: true
737 interval: 20
738 logpath: "/var/log/atop"
739 outfile: "/var/log/atop/daily.log"
740
Filip Pytloun2f70b492016-02-19 15:55:25 +0100741RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +0100742^^^^^^^^^^^^^
Filip Pytloun2f70b492016-02-19 15:55:25 +0100743
744Unfortunately ``update-motd`` is currently not available for RHEL so there's
745no native support for dynamic motd.
746You can still set static one, only pillar structure differs:
747
748.. code-block:: yaml
749
750 linux:
751 system:
752 motd: |
753 This is [company name] network.
754 Unauthorized access strictly prohibited.
755
Filip Pytloun8296bb92016-02-19 18:42:09 +0100756Haveged
757~~~~~~~
758
759If you are running headless server and are low on entropy, it may be a good
760idea to setup Haveged.
761
762.. code-block:: yaml
763
764 linux:
765 system:
766 haveged:
767 enabled: true
768
Filip Pytlounf5383a42015-10-06 16:28:32 +0200769Linux network
770-------------
771
772Linux with network manager
773
774.. code-block:: yaml
775
776 linux:
777 network:
778 enabled: true
779 network_manager: true
780
781Linux with default static network interfaces, default gateway interface and DNS servers
782
783.. code-block:: yaml
784
785 linux:
786 network:
787 enabled: true
788 interface:
789 eth0:
790 enabled: true
791 type: eth
792 address: 192.168.0.102
793 netmask: 255.255.255.0
794 gateway: 192.168.0.1
795 name_servers:
796 - 8.8.8.8
797 - 8.8.4.4
798 mtu: 1500
799
jan kaufman6d30adf2016-01-18 17:30:12 +0100800Linux with bonded interfaces and disabled NetworkManager
Filip Pytlounf5383a42015-10-06 16:28:32 +0200801
802.. code-block:: yaml
803
804 linux:
805 network:
806 enabled: true
807 interface:
808 eth0:
809 type: eth
810 ...
811 eth1:
812 type: eth
813 ...
814 bond0:
815 enabled: true
816 type: bond
817 address: 192.168.0.102
818 netmask: 255.255.255.0
819 mtu: 1500
820 use_in:
821 - interface: ${linux:interface:eth0}
822 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +0100823 network_manager:
824 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200825
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100826Linux with vlan interface_params
827
828.. code-block:: yaml
829
830 linux:
831 network:
832 enabled: true
833 interface:
834 vlan69:
835 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +0100836 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100837 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100838
Filip Pytlounf5383a42015-10-06 16:28:32 +0200839Linux with wireless interface parameters
840
841.. code-block:: yaml
842
843 linux:
844 network:
845 enabled: true
846 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100847 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200848 interface:
849 wlan0:
850 type: eth
851 wireless:
852 essid: example
853 key: example_key
854 security: wpa
855 priority: 1
856
857Linux networks with routes defined
858
859.. code-block:: yaml
860
861 linux:
862 network:
863 enabled: true
864 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100865 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200866 interface:
867 eth0:
868 type: eth
869 route:
870 default:
871 address: 192.168.0.123
872 netmask: 255.255.255.0
873 gateway: 192.168.0.1
874
875Native Linux Bridges
876
877.. code-block:: yaml
878
879 linux:
880 network:
881 interface:
882 eth1:
883 enabled: true
884 type: eth
885 proto: manual
886 up_cmds:
887 - ip address add 0/0 dev $IFACE
888 - ip link set $IFACE up
889 down_cmds:
890 - ip link set $IFACE down
891 br-ex:
892 enabled: true
893 type: bridge
894 address: ${linux:network:host:public_local:address}
895 netmask: 255.255.255.0
896 use_interfaces:
897 - eth1
898
899OpenVswitch Bridges
900
901.. code-block:: yaml
902
903 linux:
904 network:
905 bridge: openvswitch
906 interface:
907 eth1:
908 enabled: true
909 type: eth
910 proto: manual
911 up_cmds:
912 - ip address add 0/0 dev $IFACE
913 - ip link set $IFACE up
914 down_cmds:
915 - ip link set $IFACE down
916 br-ex:
917 enabled: true
918 type: bridge
919 address: ${linux:network:host:public_local:address}
920 netmask: 255.255.255.0
921 use_interfaces:
922 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +0300923 br-prv:
924 enabled: true
925 type: ovs_bridge
926 mtu: 65000
927 br-ens7:
928 enabled: true
929 name: br-ens7
930 type: ovs_bridge
931 proto: manual
932 mtu: 9000
933 use_interfaces:
934 - ens7
935 patch-br-ens7-br-prv:
936 enabled: true
937 name: ens7-prv
938 ovs_type: ovs_port
939 type: ovs_port
940 bridge: br-ens7
941 port_type: patch
942 peer: prv-ens7
943 mtu: 65000
944 patch-br-prv-br-ens7:
945 enabled: true
946 name: prv-ens7
947 bridge: br-prv
948 ovs_type: ovs_port
949 type: ovs_port
950 port_type: patch
951 peer: ens7-prv
952 mtu: 65000
953 ens7:
954 enabled: true
955 name: ens7
956 proto: manual
957 ovs_port_type: OVSPort
958 type: ovs_port
959 ovs_bridge: br-ens7
960 bridge: br-ens7
Filip Pytlounf5383a42015-10-06 16:28:32 +0200961
Petr Jediný8f8ae542017-07-13 16:19:12 +0200962Debian manual proto interfaces
963
964When you are changing interface proto from static in up state to manual, you
965may need to flush ip addresses. For example, if you want to use the interface
966and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
967to true.
968
969.. code-block:: yaml
970
971 linux:
972 network:
973 interface:
974 eth1:
975 enabled: true
976 type: eth
977 proto: manual
978 mtu: 9100
979 ipflush_onchange: true
980
981
Petr Jedinýd577cb52017-06-28 20:17:49 +0200982Concatinating and removing interface files
983
984Debian based distributions have `/etc/network/interfaces.d/` directory, where
985you can store configuration of network interfaces in separate files. You can
986concatinate the files to the defined destination when needed, this operation
987removes the file from the `/etc/network/interfaces.d/`. If you just need to
988remove iface files, you can use the `remove_iface_files` key.
989
990.. code-block:: yaml
991
992 linux:
993 network:
994 concat_iface_files:
995 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
996 dst: '/etc/network/interfaces'
997 remove_iface_files:
998 - '/etc/network/interfaces.d/90-custom.cfg'
999
1000
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001001DHCP client configuration
1002
1003None of the keys is mandatory, include only those you really need. For full list
1004of available options under send, supersede, prepend, append refer to dhcp-options(5)
1005
1006.. code-block:: yaml
1007
1008 linux:
1009 network:
1010 dhclient:
1011 enabled: true
1012 backoff_cutoff: 15
1013 initial_interval: 10
1014 reboot: 10
1015 retry: 60
1016 select_timeout: 0
1017 timeout: 120
1018 send:
1019 - option: host-name
1020 declaration: "= gethostname()"
1021 supersede:
1022 - option: host-name
1023 declaration: "spaceship"
1024 - option: domain-name
1025 declaration: "domain.home"
1026 #- option: arp-cache-timeout
1027 # declaration: 20
1028 prepend:
1029 - option: domain-name-servers
1030 declaration:
1031 - 8.8.8.8
1032 - 8.8.4.4
1033 - option: domain-search
1034 declaration:
1035 - example.com
1036 - eng.example.com
1037 #append:
1038 #- option: domain-name-servers
1039 # declaration: 127.0.0.1
1040 # ip or subnet to reject dhcp offer from
1041 reject:
1042 - 192.33.137.209
1043 - 10.0.2.0/24
1044 request:
1045 - subnet-mask
1046 - broadcast-address
1047 - time-offset
1048 - routers
1049 - domain-name
1050 - domain-name-servers
1051 - domain-search
1052 - host-name
1053 - dhcp6.name-servers
1054 - dhcp6.domain-search
1055 - dhcp6.fqdn
1056 - dhcp6.sntp-servers
1057 - netbios-name-servers
1058 - netbios-scope
1059 - interface-mtu
1060 - rfc3442-classless-static-routes
1061 - ntp-servers
1062 require:
1063 - subnet-mask
1064 - domain-name-servers
1065 # if per interface configuration required add below
1066 interface:
1067 ens2:
1068 initial_interval: 11
1069 reject:
1070 - 192.33.137.210
1071 ens3:
1072 initial_interval: 12
1073 reject:
1074 - 192.33.137.211
1075
Petr Michaleceb14b552017-06-01 10:27:05 +02001076Linux network systemd settings:
1077
1078.. code-block:: yaml
1079
1080 linux:
1081 network:
1082 ...
1083 systemd:
1084 link:
1085 10-iface-dmz:
1086 Match:
1087 MACAddress: c8:5b:67:fa:1a:af
1088 OriginalName: eth0
1089 Link:
1090 Name: dmz0
1091 netdev:
1092 20-bridge-dmz:
1093 match:
1094 name: dmz0
1095 network:
1096 mescription: bridge
1097 bridge: br-dmz0
1098 network:
1099 # works with lowercase, keys are by default capitalized
1100 40-dhcp:
1101 match:
1102 name: '*'
1103 network:
1104 DHCP: yes
1105
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001106
Petr Michalec10462bb2017-03-23 19:18:08 +01001107Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001108
Ales Komarek417e8c52017-08-25 15:10:29 +02001109Use ``/etc/environment`` for static system wide variable assignment after
1110boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001111
1112.. code-block:: yaml
1113
1114 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001115 system:
1116 env:
1117 BOB_VARIABLE: Alice
1118 ...
1119 BOB_PATH:
1120 - /srv/alice/bin
1121 - /srv/bob/bin
1122 ...
1123 ftp_proxy: none
1124 http_proxy: http://global-http-proxy.host.local:8080
1125 https_proxy: ${linux:system:proxy:https}
1126 no_proxy:
1127 - 192.168.0.80
1128 - 192.168.1.80
1129 - .domain.com
1130 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001131 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001132 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001133 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001134 ftp: ftp://proxy.host.local:2121
1135 http: http://proxy.host.local:3142
1136 https: https://proxy.host.local:3143
1137 noproxy:
1138 - .domain.com
1139 - .local
1140
1141Configure profile.d scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001142
Ales Komarek417e8c52017-08-25 15:10:29 +02001143The profile.d scripts are being sourced during .sh execution and support
1144variable expansion in opposite to /etc/environment global settings in
1145``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001146
1147.. code-block:: yaml
1148
1149 linux:
1150 system:
1151 profile:
1152 locales: |
1153 export LANG=C
1154 export LC_ALL=C
1155 ...
1156 vi_flavors.sh: |
1157 export PAGER=view
1158 export EDITOR=vim
1159 alias vi=vim
1160 shell_locales.sh: |
1161 export LANG=en_US
1162 export LC_ALL=en_US.UTF-8
1163 shell_proxies.sh: |
1164 export FTP_PROXY=ftp://127.0.3.3:2121
1165 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001166
1167Linux with hosts
1168
Filip Pytloun86506fe2017-01-26 14:36:16 +01001169Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
1170that are not defined in model except defaults for both IPv4 and IPv6 localhost
1171and hostname + fqdn.
Ales Komarek417e8c52017-08-25 15:10:29 +02001172
Filip Pytloun86506fe2017-01-26 14:36:16 +01001173It's good to use this option if you want to ensure /etc/hosts is always in a
1174clean state however it's not enabled by default for safety.
1175
Filip Pytlounf5383a42015-10-06 16:28:32 +02001176.. code-block:: yaml
1177
1178 linux:
1179 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001180 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001181 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001182 # No need to define this one if purge_hosts is true
1183 hostname:
1184 address: 127.0.1.1
1185 names:
1186 - ${linux:network:fqdn}
1187 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02001188 node1:
1189 address: 192.168.10.200
1190 names:
1191 - node2.domain.com
1192 - service2.domain.com
1193 node2:
1194 address: 192.168.10.201
1195 names:
1196 - node2.domain.com
1197 - service2.domain.com
1198
Ales Komarek417e8c52017-08-25 15:10:29 +02001199Linux with hosts collected from mine
1200
1201In this case all dns records defined within infrastrucuture will be passed to
1202local hosts records or any DNS server. Only hosts with `grain` parameter to
1203true will be propagated to the mine.
1204
1205.. code-block:: yaml
1206
1207 linux:
1208 network:
1209 purge_hosts: true
1210 mine_dns_records: true
1211 host:
1212 node1:
1213 address: 192.168.10.200
1214 grain: true
1215 names:
1216 - node2.domain.com
1217 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01001218
Filip Pytlounde9bea52016-01-11 15:39:10 +01001219Setup resolv.conf, nameservers, domain and search domains
1220
1221.. code-block:: yaml
1222
1223 linux:
1224 network:
1225 resolv:
1226 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001227 - 8.8.4.4
1228 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01001229 domain: my.example.com
1230 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001231 - my.example.com
1232 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01001233 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001234 - ndots: 5
1235 - timeout: 2
1236 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +01001237
Ales Komarek417e8c52017-08-25 15:10:29 +02001238setting custom TX queue length for tap interfaces
Andrii Petrenko735761d2017-03-21 17:17:35 -07001239
1240.. code-block:: yaml
1241
1242 linux:
1243 network:
1244 tap_custom_txqueuelen: 10000
1245
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001246DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001247
1248**DPDK OVS NIC**
1249
1250.. code-block:: yaml
1251
1252 linux:
1253 network:
1254 bridge: openvswitch
1255 dpdk:
1256 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001257 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001258 openvswitch:
1259 pmd_cpu_mask: "0x6"
1260 dpdk_socket_mem: "1024,1024"
1261 dpdk_lcore_mask: "0x400"
1262 memory_channels: 2
1263 interface:
1264 dpkd0:
1265 name: ${_param:dpdk_nic}
1266 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001267 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001268 enabled: true
1269 type: dpdk_ovs_port
1270 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001271 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001272 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01001273 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001274 br-prv:
1275 enabled: true
1276 type: dpdk_ovs_bridge
1277
1278**DPDK OVS Bond**
1279
1280.. code-block:: yaml
1281
1282 linux:
1283 network:
1284 bridge: openvswitch
1285 dpdk:
1286 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001287 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001288 openvswitch:
1289 pmd_cpu_mask: "0x6"
1290 dpdk_socket_mem: "1024,1024"
1291 dpdk_lcore_mask: "0x400"
1292 memory_channels: 2
1293 interface:
1294 dpdk_second_nic:
1295 name: ${_param:primary_second_nic}
1296 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001297 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001298 bond: dpdkbond0
1299 enabled: true
1300 type: dpdk_ovs_port
1301 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001302 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001303 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001304 dpdk_first_nic:
1305 name: ${_param:primary_first_nic}
1306 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001307 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001308 bond: dpdkbond0
1309 enabled: true
1310 type: dpdk_ovs_port
1311 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001312 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001313 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001314 dpdkbond0:
1315 enabled: true
1316 bridge: br-prv
1317 type: dpdk_ovs_bond
1318 mode: active-backup
1319 br-prv:
1320 enabled: true
1321 type: dpdk_ovs_bridge
1322
Jakub Pavlikaa759062017-03-13 15:57:26 +01001323**DPDK OVS bridge for VXLAN**
1324
1325If VXLAN is used as tenant segmentation then ip address must be set on br-prv
1326
1327.. code-block:: yaml
1328
1329 linux:
1330 network:
1331 ...
1332 interface:
1333 br-prv:
1334 enabled: true
1335 type: dpdk_ovs_bridge
1336 address: 192.168.50.0
1337 netmask: 255.255.255.0
1338 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001339
1340Linux storage
1341-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02001342
1343Linux with mounted Samba
1344
1345.. code-block:: yaml
1346
1347 linux:
1348 storage:
1349 enabled: true
1350 mount:
1351 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01001352 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001353 - path: /media/myuser/public/
1354 - device: //192.168.0.1/storage
1355 - file_system: cifs
1356 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
1357
Jiri Broulikb017f932017-03-31 13:55:36 +02001358NFS mount
1359
1360.. code-block:: yaml
1361
1362 linux:
1363 storage:
1364 enabled: true
1365 mount:
1366 nfs_glance:
1367 enabled: true
1368 path: /var/lib/glance/images
1369 device: 172.16.10.110:/var/nfs/glance
1370 file_system: nfs
1371 opts: rw,sync
1372
1373
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001374File swap configuration
Filip Pytlounf5383a42015-10-06 16:28:32 +02001375
1376.. code-block:: yaml
1377
1378 linux:
1379 storage:
1380 enabled: true
1381 swap:
1382 file:
1383 enabled: true
1384 engine: file
1385 device: /swapfile
1386 size: 1024
1387
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001388Partition swap configuration
Lachlan Evenson30676512016-01-22 15:43:28 -08001389
1390.. code-block:: yaml
1391
1392 linux:
1393 storage:
1394 enabled: true
1395 swap:
1396 partition:
1397 enabled: true
1398 engine: partition
1399 device: /dev/vg0/swap
1400
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001401LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
1402
1403.. code-block:: yaml
1404
1405 parameters:
1406 linux:
1407 storage:
1408 mount:
1409 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01001410 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001411 device: /dev/vg1/data
1412 file_system: ext4
1413 path: /mnt/data
1414 lvm:
1415 vg1:
1416 enabled: true
1417 devices:
1418 - /dev/sdb
1419 volume:
1420 data:
1421 size: 40G
1422 mount: ${linux:storage:mount:data}
1423
Jakub Pavlik4f742142017-08-08 15:05:50 +02001424Create partitions on disk. Specify size in MB. It expects empty
1425disk without any existing partitions.
1426
1427.. code-block:: yaml
1428
1429 linux:
1430 storage:
1431 disk:
1432 first_drive:
1433 name: /dev/loop1
1434 type: gpt
1435 partitions:
1436 - size: 200 #size in MB
1437 type: fat32
1438 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02001439 mkfs: True
1440 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02001441 /dev/vda1:
1442 partitions:
1443 - size: 5
1444 type: ext2
1445 - size: 10
1446 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02001447
1448Multipath with Fujitsu Eternus DXL
1449
1450.. code-block:: yaml
1451
1452 parameters:
1453 linux:
1454 storage:
1455 multipath:
1456 enabled: true
1457 blacklist_devices:
1458 - /dev/sda
1459 - /dev/sdb
1460 backends:
1461 - fujitsu_eternus_dxl
1462
1463Multipath with Hitachi VSP 1000
1464
1465.. code-block:: yaml
1466
1467 parameters:
1468 linux:
1469 storage:
1470 multipath:
1471 enabled: true
1472 blacklist_devices:
1473 - /dev/sda
1474 - /dev/sdb
1475 backends:
1476 - hitachi_vsp1000
1477
1478Multipath with IBM Storwize
1479
1480.. code-block:: yaml
1481
1482 parameters:
1483 linux:
1484 storage:
1485 multipath:
1486 enabled: true
1487 blacklist_devices:
1488 - /dev/sda
1489 - /dev/sdb
1490 backends:
1491 - ibm_storwize
1492
1493Multipath with multiple backends
1494
1495.. code-block:: yaml
1496
1497 parameters:
1498 linux:
1499 storage:
1500 multipath:
1501 enabled: true
1502 blacklist_devices:
1503 - /dev/sda
1504 - /dev/sdb
1505 - /dev/sdc
1506 - /dev/sdd
1507 backends:
1508 - ibm_storwize
1509 - fujitsu_eternus_dxl
1510 - hitachi_vsp1000
1511
1512Disabled multipath (the default setup)
1513
1514.. code-block:: yaml
1515
1516 parameters:
1517 linux:
1518 storage:
1519 multipath:
1520 enabled: false
1521
Simon Pasquier375001e2017-01-26 13:22:33 +01001522Linux with local loopback device
1523
1524.. code-block:: yaml
1525
1526 linux:
1527 storage:
1528 loopback:
1529 disk1:
1530 file: /srv/disk1
1531 size: 50G
1532
Filip Pytlounb2c8f852016-11-21 17:03:43 +01001533External config generation
1534--------------------------
1535
1536You are able to use config support metadata between formulas and only generate
1537config files for external use, eg. docker, etc.
1538
1539.. code-block:: yaml
1540
1541 parameters:
1542 linux:
1543 system:
1544 config:
1545 pillar:
1546 jenkins:
1547 master:
1548 home: /srv/volumes/jenkins
1549 approved_scripts:
1550 - method java.net.URL openConnection
1551 credentials:
1552 - type: username_password
1553 scope: global
1554 id: test
1555 desc: Testing credentials
1556 username: test
1557 password: test
1558
Vladimir Ereminccf28842017-04-10 23:52:10 +03001559Netconsole Remote Kernel Logging
1560--------------------------------
1561
1562Netconsole logger could be configured for configfs-enabled kernels
1563(`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
1564runtime (if network is already configured), and on-boot after interface
1565initialization. Notes:
1566
1567 * receiver could be located only in same L3 domain
1568 (or you need to configure gateway MAC manually)
1569 * receiver's MAC is detected only on configuration time
1570 * using broadcast MAC is not recommended
1571
1572.. code-block:: yaml
1573
1574 parameters:
1575 linux:
1576 system:
1577 netconsole:
1578 enabled: true
1579 port: 514 (optional)
1580 loglevel: debug (optional)
1581 target:
1582 192.168.0.1:
1583 interface: bond0
1584 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02001585
Filip Pytlounf5383a42015-10-06 16:28:32 +02001586Usage
1587=====
1588
1589Set mtu of network interface eth0 to 1400
1590
1591.. code-block:: bash
1592
1593 ip link set dev eth0 mtu 1400
1594
1595Read more
1596=========
1597
1598* https://www.archlinux.org/
1599* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01001600
1601Documentation and Bugs
1602======================
1603
1604To learn how to install and update salt-formulas, consult the documentation
1605available online at:
1606
1607 http://salt-formulas.readthedocs.io/
1608
1609In the unfortunate event that bugs are discovered, they should be reported to
1610the appropriate issue tracker. Use Github issue tracker for specific salt
1611formula:
1612
1613 https://github.com/salt-formulas/salt-formula-linux/issues
1614
1615For feature requests, bug reports or blueprints affecting entire ecosystem,
1616use Launchpad salt-formulas project:
1617
1618 https://launchpad.net/salt-formulas
1619
1620You can also join salt-formulas-users team and subscribe to mailing list:
1621
1622 https://launchpad.net/~salt-formulas-users
1623
1624Developers wishing to work on the salt-formulas projects should always base
1625their work on master branch and submit pull request against specific formula.
1626
1627 https://github.com/salt-formulas/salt-formula-linux
1628
1629Any questions or feedback is always welcome so feel free to join our IRC
1630channel:
1631
1632 #salt-formulas @ irc.freenode.net