blob: b90c0f59b14fa655e2771ed56527f1dac83d2d07 [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
Filip Pytlounc512e6c2017-11-22 14:28:10 +0100629Setup custom apt config options:
630
631.. code-block:: yaml
632
633 linux:
634 system:
635 apt:
636 config:
637 compression-workaround:
638 "Acquire::CompressionTypes::Order": "gz"
639 docker-clean:
640 "DPkg::Post-Invoke":
641 - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
642 "APT::Update::Post-Invoke":
643 - "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 +0200644
Petr Michalec10462bb2017-03-23 19:18:08 +0100645RC
646~~
647
Jakub Pavlik78859382016-01-21 11:26:39 +0100648rc.local example
649
650.. code-block:: yaml
651
652 linux:
653 system:
654 rc:
655 local: |
656 #!/bin/sh -e
657 #
658 # rc.local
659 #
660 # This script is executed at the end of each multiuser runlevel.
661 # Make sure that the script will "exit 0" on success or any other
662 # value on error.
663 #
664 # In order to enable or disable this script just change the execution
665 # bits.
666 #
667 # By default this script does nothing.
668 exit 0
669
Petr Michalec10462bb2017-03-23 19:18:08 +0100670
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100671Prompt
672~~~~~~
673
674Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
675user can have different prompt.
676
677.. code-block:: yaml
678
679 linux:
680 system:
681 prompt:
682 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\\]
683 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
684
685On Debian systems to set prompt system-wide it's necessary to remove setting
686PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
687``/etc/skel/.bashrc``). This formula will do this automatically, but will not
Filip Pytlound9b68da2016-01-22 15:58:41 +0100688touch existing user's ``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +0100689
Filip Pytlouneef11c12016-03-25 11:00:23 +0100690Bash
691~~~~
692
693Fix bash configuration to preserve history across sessions (like ZSH does by
694default).
695
696.. code-block:: yaml
697
698 linux:
699 system:
700 bash:
701 preserve_history: true
702
Filip Pytloune874dfb2016-01-22 16:57:34 +0100703Message of the day
704~~~~~~~~~~~~~~~~~~
705
706``pam_motd`` from package ``update-motd`` is used for dynamic messages of the
707day. Setting custom motd will cleanup existing ones.
708
709.. code-block:: yaml
710
711 linux:
712 system:
713 motd:
714 - release: |
715 #!/bin/sh
716 [ -r /etc/lsb-release ] && . /etc/lsb-release
717
718 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
719 # Fall back to using the very slow lsb_release utility
720 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
721 fi
722
723 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
724 - warning: |
725 #!/bin/sh
726 printf "This is [company name] network.\n"
727 printf "Unauthorized access strictly prohibited.\n"
728
Marek Celoud713e9072017-05-18 15:20:25 +0200729Services
730~~~~~~~~
731
732Stop and disable linux service:
733
734.. code-block:: yaml
735
736 linux:
737 system:
738 service:
739 apt-daily.timer:
740 status: dead
741
742Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
743
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +0300744Linux with atop service:
745
746.. code-block:: yaml
747
748 linux:
749 system:
750 atop:
751 enabled: true
752 interval: 20
753 logpath: "/var/log/atop"
754 outfile: "/var/log/atop/daily.log"
755
Filip Pytloun2f70b492016-02-19 15:55:25 +0100756RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +0100757^^^^^^^^^^^^^
Filip Pytloun2f70b492016-02-19 15:55:25 +0100758
759Unfortunately ``update-motd`` is currently not available for RHEL so there's
760no native support for dynamic motd.
761You can still set static one, only pillar structure differs:
762
763.. code-block:: yaml
764
765 linux:
766 system:
767 motd: |
768 This is [company name] network.
769 Unauthorized access strictly prohibited.
770
Filip Pytloun8296bb92016-02-19 18:42:09 +0100771Haveged
772~~~~~~~
773
774If you are running headless server and are low on entropy, it may be a good
775idea to setup Haveged.
776
777.. code-block:: yaml
778
779 linux:
780 system:
781 haveged:
782 enabled: true
783
Filip Pytlounf5383a42015-10-06 16:28:32 +0200784Linux network
785-------------
786
787Linux with network manager
788
789.. code-block:: yaml
790
791 linux:
792 network:
793 enabled: true
794 network_manager: true
795
796Linux with default static network interfaces, default gateway interface and DNS servers
797
798.. code-block:: yaml
799
800 linux:
801 network:
802 enabled: true
803 interface:
804 eth0:
805 enabled: true
806 type: eth
807 address: 192.168.0.102
808 netmask: 255.255.255.0
809 gateway: 192.168.0.1
810 name_servers:
811 - 8.8.8.8
812 - 8.8.4.4
813 mtu: 1500
814
jan kaufman6d30adf2016-01-18 17:30:12 +0100815Linux with bonded interfaces and disabled NetworkManager
Filip Pytlounf5383a42015-10-06 16:28:32 +0200816
817.. code-block:: yaml
818
819 linux:
820 network:
821 enabled: true
822 interface:
823 eth0:
824 type: eth
825 ...
826 eth1:
827 type: eth
828 ...
829 bond0:
830 enabled: true
831 type: bond
832 address: 192.168.0.102
833 netmask: 255.255.255.0
834 mtu: 1500
835 use_in:
836 - interface: ${linux:interface:eth0}
837 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +0100838 network_manager:
839 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200840
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100841Linux with vlan interface_params
842
843.. code-block:: yaml
844
845 linux:
846 network:
847 enabled: true
848 interface:
849 vlan69:
850 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +0100851 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100852 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100853
Filip Pytlounf5383a42015-10-06 16:28:32 +0200854Linux with wireless interface parameters
855
856.. code-block:: yaml
857
858 linux:
859 network:
860 enabled: true
861 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100862 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200863 interface:
864 wlan0:
865 type: eth
866 wireless:
867 essid: example
868 key: example_key
869 security: wpa
870 priority: 1
871
872Linux networks with routes defined
873
874.. code-block:: yaml
875
876 linux:
877 network:
878 enabled: true
879 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100880 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200881 interface:
882 eth0:
883 type: eth
884 route:
885 default:
886 address: 192.168.0.123
887 netmask: 255.255.255.0
888 gateway: 192.168.0.1
889
890Native Linux Bridges
891
892.. code-block:: yaml
893
894 linux:
895 network:
896 interface:
897 eth1:
898 enabled: true
899 type: eth
900 proto: manual
901 up_cmds:
902 - ip address add 0/0 dev $IFACE
903 - ip link set $IFACE up
904 down_cmds:
905 - ip link set $IFACE down
906 br-ex:
907 enabled: true
908 type: bridge
909 address: ${linux:network:host:public_local:address}
910 netmask: 255.255.255.0
911 use_interfaces:
912 - eth1
913
914OpenVswitch Bridges
915
916.. code-block:: yaml
917
918 linux:
919 network:
920 bridge: openvswitch
921 interface:
922 eth1:
923 enabled: true
924 type: eth
925 proto: manual
926 up_cmds:
927 - ip address add 0/0 dev $IFACE
928 - ip link set $IFACE up
929 down_cmds:
930 - ip link set $IFACE down
931 br-ex:
932 enabled: true
933 type: bridge
934 address: ${linux:network:host:public_local:address}
935 netmask: 255.255.255.0
936 use_interfaces:
937 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +0300938 br-prv:
939 enabled: true
940 type: ovs_bridge
941 mtu: 65000
942 br-ens7:
943 enabled: true
944 name: br-ens7
945 type: ovs_bridge
946 proto: manual
947 mtu: 9000
948 use_interfaces:
949 - ens7
950 patch-br-ens7-br-prv:
951 enabled: true
952 name: ens7-prv
953 ovs_type: ovs_port
954 type: ovs_port
955 bridge: br-ens7
956 port_type: patch
957 peer: prv-ens7
958 mtu: 65000
959 patch-br-prv-br-ens7:
960 enabled: true
961 name: prv-ens7
962 bridge: br-prv
963 ovs_type: ovs_port
964 type: ovs_port
965 port_type: patch
966 peer: ens7-prv
967 mtu: 65000
968 ens7:
969 enabled: true
970 name: ens7
971 proto: manual
972 ovs_port_type: OVSPort
973 type: ovs_port
974 ovs_bridge: br-ens7
975 bridge: br-ens7
Filip Pytlounf5383a42015-10-06 16:28:32 +0200976
Petr Jediný8f8ae542017-07-13 16:19:12 +0200977Debian manual proto interfaces
978
979When you are changing interface proto from static in up state to manual, you
980may need to flush ip addresses. For example, if you want to use the interface
981and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
982to true.
983
984.. code-block:: yaml
985
986 linux:
987 network:
988 interface:
989 eth1:
990 enabled: true
991 type: eth
992 proto: manual
993 mtu: 9100
994 ipflush_onchange: true
995
996
Petr Jedinýd577cb52017-06-28 20:17:49 +0200997Concatinating and removing interface files
998
999Debian based distributions have `/etc/network/interfaces.d/` directory, where
1000you can store configuration of network interfaces in separate files. You can
1001concatinate the files to the defined destination when needed, this operation
1002removes the file from the `/etc/network/interfaces.d/`. If you just need to
1003remove iface files, you can use the `remove_iface_files` key.
1004
1005.. code-block:: yaml
1006
1007 linux:
1008 network:
1009 concat_iface_files:
1010 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
1011 dst: '/etc/network/interfaces'
1012 remove_iface_files:
1013 - '/etc/network/interfaces.d/90-custom.cfg'
1014
1015
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001016DHCP client configuration
1017
1018None of the keys is mandatory, include only those you really need. For full list
1019of available options under send, supersede, prepend, append refer to dhcp-options(5)
1020
1021.. code-block:: yaml
1022
1023 linux:
1024 network:
1025 dhclient:
1026 enabled: true
1027 backoff_cutoff: 15
1028 initial_interval: 10
1029 reboot: 10
1030 retry: 60
1031 select_timeout: 0
1032 timeout: 120
1033 send:
1034 - option: host-name
1035 declaration: "= gethostname()"
1036 supersede:
1037 - option: host-name
1038 declaration: "spaceship"
1039 - option: domain-name
1040 declaration: "domain.home"
1041 #- option: arp-cache-timeout
1042 # declaration: 20
1043 prepend:
1044 - option: domain-name-servers
1045 declaration:
1046 - 8.8.8.8
1047 - 8.8.4.4
1048 - option: domain-search
1049 declaration:
1050 - example.com
1051 - eng.example.com
1052 #append:
1053 #- option: domain-name-servers
1054 # declaration: 127.0.0.1
1055 # ip or subnet to reject dhcp offer from
1056 reject:
1057 - 192.33.137.209
1058 - 10.0.2.0/24
1059 request:
1060 - subnet-mask
1061 - broadcast-address
1062 - time-offset
1063 - routers
1064 - domain-name
1065 - domain-name-servers
1066 - domain-search
1067 - host-name
1068 - dhcp6.name-servers
1069 - dhcp6.domain-search
1070 - dhcp6.fqdn
1071 - dhcp6.sntp-servers
1072 - netbios-name-servers
1073 - netbios-scope
1074 - interface-mtu
1075 - rfc3442-classless-static-routes
1076 - ntp-servers
1077 require:
1078 - subnet-mask
1079 - domain-name-servers
1080 # if per interface configuration required add below
1081 interface:
1082 ens2:
1083 initial_interval: 11
1084 reject:
1085 - 192.33.137.210
1086 ens3:
1087 initial_interval: 12
1088 reject:
1089 - 192.33.137.211
1090
Petr Michaleceb14b552017-06-01 10:27:05 +02001091Linux network systemd settings:
1092
1093.. code-block:: yaml
1094
1095 linux:
1096 network:
1097 ...
1098 systemd:
1099 link:
1100 10-iface-dmz:
1101 Match:
1102 MACAddress: c8:5b:67:fa:1a:af
1103 OriginalName: eth0
1104 Link:
1105 Name: dmz0
1106 netdev:
1107 20-bridge-dmz:
1108 match:
1109 name: dmz0
1110 network:
1111 mescription: bridge
1112 bridge: br-dmz0
1113 network:
1114 # works with lowercase, keys are by default capitalized
1115 40-dhcp:
1116 match:
1117 name: '*'
1118 network:
1119 DHCP: yes
1120
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001121
Petr Michalec10462bb2017-03-23 19:18:08 +01001122Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001123
Ales Komarek417e8c52017-08-25 15:10:29 +02001124Use ``/etc/environment`` for static system wide variable assignment after
1125boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001126
1127.. code-block:: yaml
1128
1129 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001130 system:
1131 env:
1132 BOB_VARIABLE: Alice
1133 ...
1134 BOB_PATH:
1135 - /srv/alice/bin
1136 - /srv/bob/bin
1137 ...
1138 ftp_proxy: none
1139 http_proxy: http://global-http-proxy.host.local:8080
1140 https_proxy: ${linux:system:proxy:https}
1141 no_proxy:
1142 - 192.168.0.80
1143 - 192.168.1.80
1144 - .domain.com
1145 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001146 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001147 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001148 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001149 ftp: ftp://proxy.host.local:2121
1150 http: http://proxy.host.local:3142
1151 https: https://proxy.host.local:3143
1152 noproxy:
1153 - .domain.com
1154 - .local
1155
1156Configure profile.d scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001157
Ales Komarek417e8c52017-08-25 15:10:29 +02001158The profile.d scripts are being sourced during .sh execution and support
1159variable expansion in opposite to /etc/environment global settings in
1160``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001161
1162.. code-block:: yaml
1163
1164 linux:
1165 system:
1166 profile:
1167 locales: |
1168 export LANG=C
1169 export LC_ALL=C
1170 ...
1171 vi_flavors.sh: |
1172 export PAGER=view
1173 export EDITOR=vim
1174 alias vi=vim
1175 shell_locales.sh: |
1176 export LANG=en_US
1177 export LC_ALL=en_US.UTF-8
1178 shell_proxies.sh: |
1179 export FTP_PROXY=ftp://127.0.3.3:2121
1180 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001181
1182Linux with hosts
1183
Filip Pytloun86506fe2017-01-26 14:36:16 +01001184Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
1185that are not defined in model except defaults for both IPv4 and IPv6 localhost
1186and hostname + fqdn.
Ales Komarek417e8c52017-08-25 15:10:29 +02001187
Filip Pytloun86506fe2017-01-26 14:36:16 +01001188It's good to use this option if you want to ensure /etc/hosts is always in a
1189clean state however it's not enabled by default for safety.
1190
Filip Pytlounf5383a42015-10-06 16:28:32 +02001191.. code-block:: yaml
1192
1193 linux:
1194 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001195 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001196 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001197 # No need to define this one if purge_hosts is true
1198 hostname:
1199 address: 127.0.1.1
1200 names:
1201 - ${linux:network:fqdn}
1202 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02001203 node1:
1204 address: 192.168.10.200
1205 names:
1206 - node2.domain.com
1207 - service2.domain.com
1208 node2:
1209 address: 192.168.10.201
1210 names:
1211 - node2.domain.com
1212 - service2.domain.com
1213
Ales Komarek417e8c52017-08-25 15:10:29 +02001214Linux with hosts collected from mine
1215
1216In this case all dns records defined within infrastrucuture will be passed to
1217local hosts records or any DNS server. Only hosts with `grain` parameter to
1218true will be propagated to the mine.
1219
1220.. code-block:: yaml
1221
1222 linux:
1223 network:
1224 purge_hosts: true
1225 mine_dns_records: true
1226 host:
1227 node1:
1228 address: 192.168.10.200
1229 grain: true
1230 names:
1231 - node2.domain.com
1232 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01001233
Filip Pytlounde9bea52016-01-11 15:39:10 +01001234Setup resolv.conf, nameservers, domain and search domains
1235
1236.. code-block:: yaml
1237
1238 linux:
1239 network:
1240 resolv:
1241 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001242 - 8.8.4.4
1243 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01001244 domain: my.example.com
1245 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001246 - my.example.com
1247 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01001248 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001249 - ndots: 5
1250 - timeout: 2
1251 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +01001252
Ales Komarek417e8c52017-08-25 15:10:29 +02001253setting custom TX queue length for tap interfaces
Andrii Petrenko735761d2017-03-21 17:17:35 -07001254
1255.. code-block:: yaml
1256
1257 linux:
1258 network:
1259 tap_custom_txqueuelen: 10000
1260
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001261DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001262
1263**DPDK OVS NIC**
1264
1265.. code-block:: yaml
1266
1267 linux:
1268 network:
1269 bridge: openvswitch
1270 dpdk:
1271 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001272 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001273 openvswitch:
1274 pmd_cpu_mask: "0x6"
1275 dpdk_socket_mem: "1024,1024"
1276 dpdk_lcore_mask: "0x400"
1277 memory_channels: 2
1278 interface:
1279 dpkd0:
1280 name: ${_param:dpdk_nic}
1281 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001282 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001283 enabled: true
1284 type: dpdk_ovs_port
1285 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001286 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001287 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01001288 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001289 br-prv:
1290 enabled: true
1291 type: dpdk_ovs_bridge
1292
1293**DPDK OVS Bond**
1294
1295.. code-block:: yaml
1296
1297 linux:
1298 network:
1299 bridge: openvswitch
1300 dpdk:
1301 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001302 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001303 openvswitch:
1304 pmd_cpu_mask: "0x6"
1305 dpdk_socket_mem: "1024,1024"
1306 dpdk_lcore_mask: "0x400"
1307 memory_channels: 2
1308 interface:
1309 dpdk_second_nic:
1310 name: ${_param:primary_second_nic}
1311 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001312 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001313 bond: dpdkbond0
1314 enabled: true
1315 type: dpdk_ovs_port
1316 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001317 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001318 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001319 dpdk_first_nic:
1320 name: ${_param:primary_first_nic}
1321 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001322 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001323 bond: dpdkbond0
1324 enabled: true
1325 type: dpdk_ovs_port
1326 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001327 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001328 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001329 dpdkbond0:
1330 enabled: true
1331 bridge: br-prv
1332 type: dpdk_ovs_bond
1333 mode: active-backup
1334 br-prv:
1335 enabled: true
1336 type: dpdk_ovs_bridge
1337
Jakub Pavlikaa759062017-03-13 15:57:26 +01001338**DPDK OVS bridge for VXLAN**
1339
1340If VXLAN is used as tenant segmentation then ip address must be set on br-prv
1341
1342.. code-block:: yaml
1343
1344 linux:
1345 network:
1346 ...
1347 interface:
1348 br-prv:
1349 enabled: true
1350 type: dpdk_ovs_bridge
1351 address: 192.168.50.0
1352 netmask: 255.255.255.0
1353 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001354
1355Linux storage
1356-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02001357
1358Linux with mounted Samba
1359
1360.. code-block:: yaml
1361
1362 linux:
1363 storage:
1364 enabled: true
1365 mount:
1366 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01001367 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001368 - path: /media/myuser/public/
1369 - device: //192.168.0.1/storage
1370 - file_system: cifs
1371 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
1372
Jiri Broulikb017f932017-03-31 13:55:36 +02001373NFS mount
1374
1375.. code-block:: yaml
1376
1377 linux:
1378 storage:
1379 enabled: true
1380 mount:
1381 nfs_glance:
1382 enabled: true
1383 path: /var/lib/glance/images
1384 device: 172.16.10.110:/var/nfs/glance
1385 file_system: nfs
1386 opts: rw,sync
1387
1388
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001389File swap configuration
Filip Pytlounf5383a42015-10-06 16:28:32 +02001390
1391.. code-block:: yaml
1392
1393 linux:
1394 storage:
1395 enabled: true
1396 swap:
1397 file:
1398 enabled: true
1399 engine: file
1400 device: /swapfile
1401 size: 1024
1402
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001403Partition swap configuration
Lachlan Evenson30676512016-01-22 15:43:28 -08001404
1405.. code-block:: yaml
1406
1407 linux:
1408 storage:
1409 enabled: true
1410 swap:
1411 partition:
1412 enabled: true
1413 engine: partition
1414 device: /dev/vg0/swap
1415
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001416LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
1417
1418.. code-block:: yaml
1419
1420 parameters:
1421 linux:
1422 storage:
1423 mount:
1424 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01001425 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001426 device: /dev/vg1/data
1427 file_system: ext4
1428 path: /mnt/data
1429 lvm:
1430 vg1:
1431 enabled: true
1432 devices:
1433 - /dev/sdb
1434 volume:
1435 data:
1436 size: 40G
1437 mount: ${linux:storage:mount:data}
1438
Jakub Pavlik4f742142017-08-08 15:05:50 +02001439Create partitions on disk. Specify size in MB. It expects empty
Piotr Krukd51911b2017-12-04 11:27:08 +01001440disk without any existing partitions. (set startsector=1, if you want to start partitions from 2048)
Jakub Pavlik4f742142017-08-08 15:05:50 +02001441
1442.. code-block:: yaml
1443
1444 linux:
1445 storage:
1446 disk:
1447 first_drive:
Piotr Krukd51911b2017-12-04 11:27:08 +01001448 startsector: 1
Jakub Pavlik4f742142017-08-08 15:05:50 +02001449 name: /dev/loop1
1450 type: gpt
1451 partitions:
1452 - size: 200 #size in MB
1453 type: fat32
1454 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02001455 mkfs: True
1456 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02001457 /dev/vda1:
1458 partitions:
1459 - size: 5
1460 type: ext2
1461 - size: 10
1462 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02001463
1464Multipath with Fujitsu Eternus DXL
1465
1466.. code-block:: yaml
1467
1468 parameters:
1469 linux:
1470 storage:
1471 multipath:
1472 enabled: true
1473 blacklist_devices:
1474 - /dev/sda
1475 - /dev/sdb
1476 backends:
1477 - fujitsu_eternus_dxl
1478
1479Multipath with Hitachi VSP 1000
1480
1481.. code-block:: yaml
1482
1483 parameters:
1484 linux:
1485 storage:
1486 multipath:
1487 enabled: true
1488 blacklist_devices:
1489 - /dev/sda
1490 - /dev/sdb
1491 backends:
1492 - hitachi_vsp1000
1493
1494Multipath with IBM Storwize
1495
1496.. code-block:: yaml
1497
1498 parameters:
1499 linux:
1500 storage:
1501 multipath:
1502 enabled: true
1503 blacklist_devices:
1504 - /dev/sda
1505 - /dev/sdb
1506 backends:
1507 - ibm_storwize
1508
1509Multipath with multiple backends
1510
1511.. code-block:: yaml
1512
1513 parameters:
1514 linux:
1515 storage:
1516 multipath:
1517 enabled: true
1518 blacklist_devices:
1519 - /dev/sda
1520 - /dev/sdb
1521 - /dev/sdc
1522 - /dev/sdd
1523 backends:
1524 - ibm_storwize
1525 - fujitsu_eternus_dxl
1526 - hitachi_vsp1000
1527
1528Disabled multipath (the default setup)
1529
1530.. code-block:: yaml
1531
1532 parameters:
1533 linux:
1534 storage:
1535 multipath:
1536 enabled: false
1537
Simon Pasquier375001e2017-01-26 13:22:33 +01001538Linux with local loopback device
1539
1540.. code-block:: yaml
1541
1542 linux:
1543 storage:
1544 loopback:
1545 disk1:
1546 file: /srv/disk1
1547 size: 50G
1548
Filip Pytlounb2c8f852016-11-21 17:03:43 +01001549External config generation
1550--------------------------
1551
1552You are able to use config support metadata between formulas and only generate
1553config files for external use, eg. docker, etc.
1554
1555.. code-block:: yaml
1556
1557 parameters:
1558 linux:
1559 system:
1560 config:
1561 pillar:
1562 jenkins:
1563 master:
1564 home: /srv/volumes/jenkins
1565 approved_scripts:
1566 - method java.net.URL openConnection
1567 credentials:
1568 - type: username_password
1569 scope: global
1570 id: test
1571 desc: Testing credentials
1572 username: test
1573 password: test
1574
Vladimir Ereminccf28842017-04-10 23:52:10 +03001575Netconsole Remote Kernel Logging
1576--------------------------------
1577
1578Netconsole logger could be configured for configfs-enabled kernels
1579(`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
1580runtime (if network is already configured), and on-boot after interface
1581initialization. Notes:
1582
1583 * receiver could be located only in same L3 domain
1584 (or you need to configure gateway MAC manually)
1585 * receiver's MAC is detected only on configuration time
1586 * using broadcast MAC is not recommended
1587
1588.. code-block:: yaml
1589
1590 parameters:
1591 linux:
1592 system:
1593 netconsole:
1594 enabled: true
1595 port: 514 (optional)
1596 loglevel: debug (optional)
1597 target:
1598 192.168.0.1:
1599 interface: bond0
1600 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02001601
Filip Pytlounf5383a42015-10-06 16:28:32 +02001602Usage
1603=====
1604
1605Set mtu of network interface eth0 to 1400
1606
1607.. code-block:: bash
1608
1609 ip link set dev eth0 mtu 1400
1610
1611Read more
1612=========
1613
1614* https://www.archlinux.org/
1615* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01001616
1617Documentation and Bugs
1618======================
1619
1620To learn how to install and update salt-formulas, consult the documentation
1621available online at:
1622
1623 http://salt-formulas.readthedocs.io/
1624
1625In the unfortunate event that bugs are discovered, they should be reported to
1626the appropriate issue tracker. Use Github issue tracker for specific salt
1627formula:
1628
1629 https://github.com/salt-formulas/salt-formula-linux/issues
1630
1631For feature requests, bug reports or blueprints affecting entire ecosystem,
1632use Launchpad salt-formulas project:
1633
1634 https://launchpad.net/salt-formulas
1635
1636You can also join salt-formulas-users team and subscribe to mailing list:
1637
1638 https://launchpad.net/~salt-formulas-users
1639
1640Developers wishing to work on the salt-formulas projects should always base
1641their work on master branch and submit pull request against specific formula.
1642
1643 https://github.com/salt-formulas/salt-formula-linux
1644
1645Any questions or feedback is always welcome so feel free to join our IRC
1646channel:
1647
1648 #salt-formulas @ irc.freenode.net