blob: 1449ee1725789ce72968c55d0d54687449f722b6 [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
Nick Metzf04f5f32018-01-08 15:25:04 +0100423
424Shared Libraries
425~~~~~~~~~~~~~~~~
426
427Set additional shared library to Linux system library path
428
429.. code-block:: yaml
430
431 linux:
432 system:
433 ld:
434 library:
435 java:
436 - /usr/lib/jvm/jre-openjdk/lib/amd64/server
437 - /opt/java/jre/lib/amd64/server
438
439
Filip Pytloun2fde88b2017-10-05 10:30:29 +0200440Certificates
441~~~~~~~~~~~~
442
443Add certificate authority into system trusted CA bundle
444
445.. code-block:: yaml
446
447 linux:
448 system:
449 ca_certificates:
450 mycert: |
451 -----BEGIN CERTIFICATE-----
452 MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
453 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
454 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
455 MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
456 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
457 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
458 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
459 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
460 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
461 CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
462 lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
463 AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
464 -----END CERTIFICATE-----
465
Filip Pytloun361096c2017-08-23 10:57:20 +0200466Sysfs
467~~~~~
468
469Install sysfsutils and set sysfs attributes:
470
471.. code-block:: yaml
472
473 linux:
474 system:
475 sysfs:
476 scheduler:
477 block/sda/queue/scheduler: deadline
478 power:
479 mode:
480 power/state: 0660
481 owner:
482 power/state: "root:power"
483 devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave
484
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100485Huge Pages
486~~~~~~~~~~~~
487
488Huge Pages give a performance boost to applications that intensively deal
489with memory allocation/deallocation by decreasing memory fragmentation.
490
491.. code-block:: yaml
492
493 linux:
494 system:
495 kernel:
496 hugepages:
497 small:
498 size: 2M
499 count: 107520
500 mount_point: /mnt/hugepages_2MB
501 mount: false/true # default false
502 large:
503 default: true # default automatically mounted
504 size: 1G
505 count: 210
506 mount_point: /mnt/hugepages_1GB
507
508Note: not recommended to use both pagesizes in concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100509
Jakub Pavlik5398d872017-02-13 22:30:47 +0100510Intel SR-IOV
511~~~~~~~~~~~~
512
513PCI-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.
514
515.. code-block:: yaml
516
517 linux:
518 system:
519 kernel:
520 sriov: True
521 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
522 rc:
523 local: |
524 #!/bin/sh -e
525 # Enable 7 VF on eth1
526 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
527 exit 0
528
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100529Isolate CPU options
530~~~~~~~~~~~~~~~~~~~
531
532Remove the specified CPUs, as defined by the cpu_number values, from the general kernel
533SMP balancing and scheduler algroithms. The only way to move a process onto or off an
534"isolated" CPU is via the CPU affinity syscalls. cpu_number begins at 0, so the
535maximum value is 1 less than the number of CPUs on the system.
536
537.. code-block:: yaml
538
539 linux:
540 system:
541 kernel:
542 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100543
Filip Pytlounf5383a42015-10-06 16:28:32 +0200544Repositories
545~~~~~~~~~~~~
546
547RedHat based Linux with additional OpenStack repo
548
549.. code-block:: yaml
550
551 linux:
552 system:
553 ...
554 repo:
555 rdo-icehouse:
556 enabled: true
557 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
558 pgpcheck: 0
559
560Ensure system repository to use czech Debian mirror (``default: true``)
561Also pin it's packages with priority 900.
562
563.. code-block:: yaml
564
565 linux:
566 system:
567 repo:
568 debian:
569 default: true
570 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
571 # Import signing key from URL if needed
572 key_url: "http://dummy.com/public.gpg"
573 pin:
574 - pin: 'origin "ftp.cz.debian.org"'
575 priority: 900
576 package: '*'
577
Petr Michalec10462bb2017-03-23 19:18:08 +0100578
579Package manager proxy setup globally:
580
581.. code-block:: yaml
582
583 linux:
584 system:
585 ...
586 repo:
587 apt-mk:
588 source: "deb http://apt-mk.mirantis.com/ stable main salt"
589 ...
590 proxy:
591 pkg:
592 enabled: true
593 ftp: ftp://ftp-proxy-for-apt.host.local:2121
594 ...
595 # NOTE: Global defaults for any other componet that configure proxy on the system.
596 # If your environment has just one simple proxy, set it on linux:system:proxy.
597 #
598 # fall back system defaults if linux:system:proxy:pkg has no protocol specific entries
599 # as for https and http
600 ftp: ftp://proxy.host.local:2121
601 http: http://proxy.host.local:3142
602 https: https://proxy.host.local:3143
603
604Package manager proxy setup per repository:
605
606.. code-block:: yaml
607
608 linux:
609 system:
610 ...
611 repo:
612 debian:
613 source: "deb http://apt-mk.mirantis.com/ stable main salt"
614 ...
615 apt-mk:
616 source: "deb http://apt-mk.mirantis.com/ stable main salt"
617 # per repository proxy
618 proxy:
619 enabled: true
620 http: http://maas-01:8080
621 https: http://maas-01:8080
622 ...
623 proxy:
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600624 # package manager fallback defaults
Petr Michalec10462bb2017-03-23 19:18:08 +0100625 # used if linux:system:repo:apt-mk:proxy has no protocol specific entries
626 pkg:
627 enabled: true
628 ftp: ftp://proxy.host.local:2121
629 #http: http://proxy.host.local:3142
630 #https: https://proxy.host.local:3143
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -0600631 ...
Petr Michalec10462bb2017-03-23 19:18:08 +0100632 # global system fallback system defaults
633 ftp: ftp://proxy.host.local:2121
634 http: http://proxy.host.local:3142
635 https: https://proxy.host.local:3143
636
637
Jiri Broulik34a29b42017-04-25 14:42:54 +0200638Remove all repositories:
639
640.. code-block:: yaml
641
642 linux:
643 system:
644 purge_repos: true
645
Filip Pytlounc512e6c2017-11-22 14:28:10 +0100646Setup custom apt config options:
647
648.. code-block:: yaml
649
650 linux:
651 system:
652 apt:
653 config:
654 compression-workaround:
655 "Acquire::CompressionTypes::Order": "gz"
656 docker-clean:
657 "DPkg::Post-Invoke":
658 - "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"
659 "APT::Update::Post-Invoke":
660 - "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 +0200661
Petr Michalec10462bb2017-03-23 19:18:08 +0100662RC
663~~
664
Jakub Pavlik78859382016-01-21 11:26:39 +0100665rc.local example
666
667.. code-block:: yaml
668
669 linux:
670 system:
671 rc:
672 local: |
673 #!/bin/sh -e
674 #
675 # rc.local
676 #
677 # This script is executed at the end of each multiuser runlevel.
678 # Make sure that the script will "exit 0" on success or any other
679 # value on error.
680 #
681 # In order to enable or disable this script just change the execution
682 # bits.
683 #
684 # By default this script does nothing.
685 exit 0
686
Petr Michalec10462bb2017-03-23 19:18:08 +0100687
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100688Prompt
689~~~~~~
690
691Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
692user can have different prompt.
693
694.. code-block:: yaml
695
696 linux:
697 system:
698 prompt:
699 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\\]
700 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
701
702On Debian systems to set prompt system-wide it's necessary to remove setting
703PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
704``/etc/skel/.bashrc``). This formula will do this automatically, but will not
Filip Pytlound9b68da2016-01-22 15:58:41 +0100705touch existing user's ``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +0100706
Filip Pytlouneef11c12016-03-25 11:00:23 +0100707Bash
708~~~~
709
710Fix bash configuration to preserve history across sessions (like ZSH does by
711default).
712
713.. code-block:: yaml
714
715 linux:
716 system:
717 bash:
718 preserve_history: true
719
Filip Pytloune874dfb2016-01-22 16:57:34 +0100720Message of the day
721~~~~~~~~~~~~~~~~~~
722
723``pam_motd`` from package ``update-motd`` is used for dynamic messages of the
724day. Setting custom motd will cleanup existing ones.
725
726.. code-block:: yaml
727
728 linux:
729 system:
730 motd:
731 - release: |
732 #!/bin/sh
733 [ -r /etc/lsb-release ] && . /etc/lsb-release
734
735 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
736 # Fall back to using the very slow lsb_release utility
737 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
738 fi
739
740 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
741 - warning: |
742 #!/bin/sh
743 printf "This is [company name] network.\n"
744 printf "Unauthorized access strictly prohibited.\n"
745
Marek Celoud713e9072017-05-18 15:20:25 +0200746Services
747~~~~~~~~
748
749Stop and disable linux service:
750
751.. code-block:: yaml
752
753 linux:
754 system:
755 service:
756 apt-daily.timer:
757 status: dead
758
759Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
760
Serhiy Ovsianikov67bd56a2017-08-11 15:56:01 +0300761Linux with atop service:
762
763.. code-block:: yaml
764
765 linux:
766 system:
767 atop:
768 enabled: true
769 interval: 20
770 logpath: "/var/log/atop"
771 outfile: "/var/log/atop/daily.log"
772
Filip Pytloun2f70b492016-02-19 15:55:25 +0100773RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +0100774^^^^^^^^^^^^^
Filip Pytloun2f70b492016-02-19 15:55:25 +0100775
776Unfortunately ``update-motd`` is currently not available for RHEL so there's
777no native support for dynamic motd.
778You can still set static one, only pillar structure differs:
779
780.. code-block:: yaml
781
782 linux:
783 system:
784 motd: |
785 This is [company name] network.
786 Unauthorized access strictly prohibited.
787
Filip Pytloun8296bb92016-02-19 18:42:09 +0100788Haveged
789~~~~~~~
790
791If you are running headless server and are low on entropy, it may be a good
792idea to setup Haveged.
793
794.. code-block:: yaml
795
796 linux:
797 system:
798 haveged:
799 enabled: true
800
Filip Pytlounf5383a42015-10-06 16:28:32 +0200801Linux network
802-------------
803
804Linux with network manager
805
806.. code-block:: yaml
807
808 linux:
809 network:
810 enabled: true
811 network_manager: true
812
813Linux with default static network interfaces, default gateway interface and DNS servers
814
815.. code-block:: yaml
816
817 linux:
818 network:
819 enabled: true
820 interface:
821 eth0:
822 enabled: true
823 type: eth
824 address: 192.168.0.102
825 netmask: 255.255.255.0
826 gateway: 192.168.0.1
827 name_servers:
828 - 8.8.8.8
829 - 8.8.4.4
830 mtu: 1500
831
jan kaufman6d30adf2016-01-18 17:30:12 +0100832Linux with bonded interfaces and disabled NetworkManager
Filip Pytlounf5383a42015-10-06 16:28:32 +0200833
834.. code-block:: yaml
835
836 linux:
837 network:
838 enabled: true
839 interface:
840 eth0:
841 type: eth
842 ...
843 eth1:
844 type: eth
845 ...
846 bond0:
847 enabled: true
848 type: bond
849 address: 192.168.0.102
850 netmask: 255.255.255.0
851 mtu: 1500
852 use_in:
853 - interface: ${linux:interface:eth0}
854 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +0100855 network_manager:
856 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200857
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100858Linux with vlan interface_params
859
860.. code-block:: yaml
861
862 linux:
863 network:
864 enabled: true
865 interface:
866 vlan69:
867 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +0100868 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100869 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100870
Filip Pytlounf5383a42015-10-06 16:28:32 +0200871Linux with wireless interface parameters
872
873.. code-block:: yaml
874
875 linux:
876 network:
877 enabled: true
878 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100879 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200880 interface:
881 wlan0:
882 type: eth
883 wireless:
884 essid: example
885 key: example_key
886 security: wpa
887 priority: 1
888
889Linux networks with routes defined
890
891.. code-block:: yaml
892
893 linux:
894 network:
895 enabled: true
896 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100897 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200898 interface:
899 eth0:
900 type: eth
901 route:
902 default:
903 address: 192.168.0.123
904 netmask: 255.255.255.0
905 gateway: 192.168.0.1
906
907Native Linux Bridges
908
909.. code-block:: yaml
910
911 linux:
912 network:
913 interface:
914 eth1:
915 enabled: true
916 type: eth
917 proto: manual
918 up_cmds:
919 - ip address add 0/0 dev $IFACE
920 - ip link set $IFACE up
921 down_cmds:
922 - ip link set $IFACE down
923 br-ex:
924 enabled: true
925 type: bridge
926 address: ${linux:network:host:public_local:address}
927 netmask: 255.255.255.0
928 use_interfaces:
929 - eth1
930
931OpenVswitch Bridges
932
933.. code-block:: yaml
934
935 linux:
936 network:
937 bridge: openvswitch
938 interface:
939 eth1:
940 enabled: true
941 type: eth
942 proto: manual
943 up_cmds:
944 - ip address add 0/0 dev $IFACE
945 - ip link set $IFACE up
946 down_cmds:
947 - ip link set $IFACE down
948 br-ex:
949 enabled: true
950 type: bridge
951 address: ${linux:network:host:public_local:address}
952 netmask: 255.255.255.0
953 use_interfaces:
954 - eth1
Dmitry Stremkouskia581ea72017-10-18 14:24:16 +0300955 br-prv:
956 enabled: true
957 type: ovs_bridge
958 mtu: 65000
959 br-ens7:
960 enabled: true
961 name: br-ens7
962 type: ovs_bridge
963 proto: manual
964 mtu: 9000
965 use_interfaces:
966 - ens7
967 patch-br-ens7-br-prv:
968 enabled: true
969 name: ens7-prv
970 ovs_type: ovs_port
971 type: ovs_port
972 bridge: br-ens7
973 port_type: patch
974 peer: prv-ens7
975 mtu: 65000
976 patch-br-prv-br-ens7:
977 enabled: true
978 name: prv-ens7
979 bridge: br-prv
980 ovs_type: ovs_port
981 type: ovs_port
982 port_type: patch
983 peer: ens7-prv
984 mtu: 65000
985 ens7:
986 enabled: true
987 name: ens7
988 proto: manual
989 ovs_port_type: OVSPort
990 type: ovs_port
991 ovs_bridge: br-ens7
992 bridge: br-ens7
Filip Pytlounf5383a42015-10-06 16:28:32 +0200993
Petr Jediný8f8ae542017-07-13 16:19:12 +0200994Debian manual proto interfaces
995
996When you are changing interface proto from static in up state to manual, you
997may need to flush ip addresses. For example, if you want to use the interface
998and the ip on the bridge. This can be done by setting the ``ipflush_onchange``
999to true.
1000
1001.. code-block:: yaml
1002
1003 linux:
1004 network:
1005 interface:
1006 eth1:
1007 enabled: true
1008 type: eth
1009 proto: manual
1010 mtu: 9100
1011 ipflush_onchange: true
1012
1013
Petr Jedinýd577cb52017-06-28 20:17:49 +02001014Concatinating and removing interface files
1015
1016Debian based distributions have `/etc/network/interfaces.d/` directory, where
1017you can store configuration of network interfaces in separate files. You can
1018concatinate the files to the defined destination when needed, this operation
1019removes the file from the `/etc/network/interfaces.d/`. If you just need to
1020remove iface files, you can use the `remove_iface_files` key.
1021
1022.. code-block:: yaml
1023
1024 linux:
1025 network:
1026 concat_iface_files:
1027 - src: '/etc/network/interfaces.d/50-cloud-init.cfg'
1028 dst: '/etc/network/interfaces'
1029 remove_iface_files:
1030 - '/etc/network/interfaces.d/90-custom.cfg'
1031
1032
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001033DHCP client configuration
1034
1035None of the keys is mandatory, include only those you really need. For full list
1036of available options under send, supersede, prepend, append refer to dhcp-options(5)
1037
1038.. code-block:: yaml
1039
1040 linux:
1041 network:
1042 dhclient:
1043 enabled: true
1044 backoff_cutoff: 15
1045 initial_interval: 10
1046 reboot: 10
1047 retry: 60
1048 select_timeout: 0
1049 timeout: 120
1050 send:
1051 - option: host-name
1052 declaration: "= gethostname()"
1053 supersede:
1054 - option: host-name
1055 declaration: "spaceship"
1056 - option: domain-name
1057 declaration: "domain.home"
1058 #- option: arp-cache-timeout
1059 # declaration: 20
1060 prepend:
1061 - option: domain-name-servers
1062 declaration:
1063 - 8.8.8.8
1064 - 8.8.4.4
1065 - option: domain-search
1066 declaration:
1067 - example.com
1068 - eng.example.com
1069 #append:
1070 #- option: domain-name-servers
1071 # declaration: 127.0.0.1
1072 # ip or subnet to reject dhcp offer from
1073 reject:
1074 - 192.33.137.209
1075 - 10.0.2.0/24
1076 request:
1077 - subnet-mask
1078 - broadcast-address
1079 - time-offset
1080 - routers
1081 - domain-name
1082 - domain-name-servers
1083 - domain-search
1084 - host-name
1085 - dhcp6.name-servers
1086 - dhcp6.domain-search
1087 - dhcp6.fqdn
1088 - dhcp6.sntp-servers
1089 - netbios-name-servers
1090 - netbios-scope
1091 - interface-mtu
1092 - rfc3442-classless-static-routes
1093 - ntp-servers
1094 require:
1095 - subnet-mask
1096 - domain-name-servers
1097 # if per interface configuration required add below
1098 interface:
1099 ens2:
1100 initial_interval: 11
1101 reject:
1102 - 192.33.137.210
1103 ens3:
1104 initial_interval: 12
1105 reject:
1106 - 192.33.137.211
1107
Petr Michaleceb14b552017-06-01 10:27:05 +02001108Linux network systemd settings:
1109
1110.. code-block:: yaml
1111
1112 linux:
1113 network:
1114 ...
1115 systemd:
1116 link:
1117 10-iface-dmz:
1118 Match:
1119 MACAddress: c8:5b:67:fa:1a:af
1120 OriginalName: eth0
1121 Link:
1122 Name: dmz0
1123 netdev:
1124 20-bridge-dmz:
1125 match:
1126 name: dmz0
1127 network:
1128 mescription: bridge
1129 bridge: br-dmz0
1130 network:
1131 # works with lowercase, keys are by default capitalized
1132 40-dhcp:
1133 match:
1134 name: '*'
1135 network:
1136 DHCP: yes
1137
Oleksandr Vlasov27a6c3a2017-04-11 16:01:19 -06001138
Petr Michalec10462bb2017-03-23 19:18:08 +01001139Configure global environment variables
Petr Michalec10462bb2017-03-23 19:18:08 +01001140
Ales Komarek417e8c52017-08-25 15:10:29 +02001141Use ``/etc/environment`` for static system wide variable assignment after
1142boot. Variable expansion is frequently not supported.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001143
1144.. code-block:: yaml
1145
1146 linux:
Petr Michalec10462bb2017-03-23 19:18:08 +01001147 system:
1148 env:
1149 BOB_VARIABLE: Alice
1150 ...
1151 BOB_PATH:
1152 - /srv/alice/bin
1153 - /srv/bob/bin
1154 ...
1155 ftp_proxy: none
1156 http_proxy: http://global-http-proxy.host.local:8080
1157 https_proxy: ${linux:system:proxy:https}
1158 no_proxy:
1159 - 192.168.0.80
1160 - 192.168.1.80
1161 - .domain.com
1162 - .local
Filip Pytlounf5383a42015-10-06 16:28:32 +02001163 ...
Petr Michalec10462bb2017-03-23 19:18:08 +01001164 # NOTE: global defaults proxy configuration.
Filip Pytlounf5383a42015-10-06 16:28:32 +02001165 proxy:
Petr Michalec10462bb2017-03-23 19:18:08 +01001166 ftp: ftp://proxy.host.local:2121
1167 http: http://proxy.host.local:3142
1168 https: https://proxy.host.local:3143
1169 noproxy:
1170 - .domain.com
1171 - .local
1172
1173Configure profile.d scripts
Petr Michalec10462bb2017-03-23 19:18:08 +01001174
Ales Komarek417e8c52017-08-25 15:10:29 +02001175The profile.d scripts are being sourced during .sh execution and support
1176variable expansion in opposite to /etc/environment global settings in
1177``/etc/environment``.
Petr Michalec10462bb2017-03-23 19:18:08 +01001178
1179.. code-block:: yaml
1180
1181 linux:
1182 system:
1183 profile:
1184 locales: |
1185 export LANG=C
1186 export LC_ALL=C
1187 ...
1188 vi_flavors.sh: |
1189 export PAGER=view
1190 export EDITOR=vim
1191 alias vi=vim
1192 shell_locales.sh: |
1193 export LANG=en_US
1194 export LC_ALL=en_US.UTF-8
1195 shell_proxies.sh: |
1196 export FTP_PROXY=ftp://127.0.3.3:2121
1197 export NO_PROXY='.local'
Filip Pytlounf5383a42015-10-06 16:28:32 +02001198
1199Linux with hosts
1200
Filip Pytloun86506fe2017-01-26 14:36:16 +01001201Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
1202that are not defined in model except defaults for both IPv4 and IPv6 localhost
1203and hostname + fqdn.
Ales Komarek417e8c52017-08-25 15:10:29 +02001204
Filip Pytloun86506fe2017-01-26 14:36:16 +01001205It's good to use this option if you want to ensure /etc/hosts is always in a
1206clean state however it's not enabled by default for safety.
1207
Filip Pytlounf5383a42015-10-06 16:28:32 +02001208.. code-block:: yaml
1209
1210 linux:
1211 network:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001212 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001213 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +01001214 # No need to define this one if purge_hosts is true
1215 hostname:
1216 address: 127.0.1.1
1217 names:
1218 - ${linux:network:fqdn}
1219 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +02001220 node1:
1221 address: 192.168.10.200
1222 names:
1223 - node2.domain.com
1224 - service2.domain.com
1225 node2:
1226 address: 192.168.10.201
1227 names:
1228 - node2.domain.com
1229 - service2.domain.com
1230
Ales Komarek417e8c52017-08-25 15:10:29 +02001231Linux with hosts collected from mine
1232
1233In this case all dns records defined within infrastrucuture will be passed to
1234local hosts records or any DNS server. Only hosts with `grain` parameter to
1235true will be propagated to the mine.
1236
1237.. code-block:: yaml
1238
1239 linux:
1240 network:
1241 purge_hosts: true
1242 mine_dns_records: true
1243 host:
1244 node1:
1245 address: 192.168.10.200
1246 grain: true
1247 names:
1248 - node2.domain.com
1249 - service2.domain.com
Filip Pytloun86506fe2017-01-26 14:36:16 +01001250
Filip Pytlounde9bea52016-01-11 15:39:10 +01001251Setup resolv.conf, nameservers, domain and search domains
1252
1253.. code-block:: yaml
1254
1255 linux:
1256 network:
1257 resolv:
1258 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001259 - 8.8.4.4
1260 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +01001261 domain: my.example.com
1262 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001263 - my.example.com
1264 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +01001265 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001266 - ndots: 5
1267 - timeout: 2
1268 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +01001269
Ales Komarek417e8c52017-08-25 15:10:29 +02001270setting custom TX queue length for tap interfaces
Andrii Petrenko735761d2017-03-21 17:17:35 -07001271
1272.. code-block:: yaml
1273
1274 linux:
1275 network:
1276 tap_custom_txqueuelen: 10000
1277
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001278DPDK OVS interfaces
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001279
1280**DPDK OVS NIC**
1281
1282.. code-block:: yaml
1283
1284 linux:
1285 network:
1286 bridge: openvswitch
1287 dpdk:
1288 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001289 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001290 openvswitch:
1291 pmd_cpu_mask: "0x6"
1292 dpdk_socket_mem: "1024,1024"
1293 dpdk_lcore_mask: "0x400"
1294 memory_channels: 2
1295 interface:
1296 dpkd0:
1297 name: ${_param:dpdk_nic}
1298 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001299 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001300 enabled: true
1301 type: dpdk_ovs_port
1302 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001303 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001304 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +01001305 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001306 br-prv:
1307 enabled: true
1308 type: dpdk_ovs_bridge
1309
1310**DPDK OVS Bond**
1311
1312.. code-block:: yaml
1313
1314 linux:
1315 network:
1316 bridge: openvswitch
1317 dpdk:
1318 enabled: true
Oleg Bondarev9a466792017-05-25 15:55:42 +04001319 driver: uio/vfio
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001320 openvswitch:
1321 pmd_cpu_mask: "0x6"
1322 dpdk_socket_mem: "1024,1024"
1323 dpdk_lcore_mask: "0x400"
1324 memory_channels: 2
1325 interface:
1326 dpdk_second_nic:
1327 name: ${_param:primary_second_nic}
1328 pci: 0000:06:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001329 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001330 bond: dpdkbond0
1331 enabled: true
1332 type: dpdk_ovs_port
1333 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001334 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001335 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001336 dpdk_first_nic:
1337 name: ${_param:primary_first_nic}
1338 pci: 0000:05:00.0
Oleg Bondarev9a466792017-05-25 15:55:42 +04001339 driver: igb_uio/vfio-pci
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001340 bond: dpdkbond0
1341 enabled: true
1342 type: dpdk_ovs_port
1343 n_rxq: 2
Oleg Bondarev43dbbd32017-05-24 17:06:19 +04001344 pmd_rxq_affinity: "0:1,1:2"
Jakub Pavlikaa759062017-03-13 15:57:26 +01001345 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001346 dpdkbond0:
1347 enabled: true
1348 bridge: br-prv
1349 type: dpdk_ovs_bond
1350 mode: active-backup
1351 br-prv:
1352 enabled: true
1353 type: dpdk_ovs_bridge
1354
Jakub Pavlikaa759062017-03-13 15:57:26 +01001355**DPDK OVS bridge for VXLAN**
1356
1357If VXLAN is used as tenant segmentation then ip address must be set on br-prv
1358
1359.. code-block:: yaml
1360
1361 linux:
1362 network:
1363 ...
1364 interface:
1365 br-prv:
1366 enabled: true
1367 type: dpdk_ovs_bridge
1368 address: 192.168.50.0
1369 netmask: 255.255.255.0
1370 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001371
1372Linux storage
1373-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +02001374
1375Linux with mounted Samba
1376
1377.. code-block:: yaml
1378
1379 linux:
1380 storage:
1381 enabled: true
1382 mount:
1383 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +01001384 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +02001385 - path: /media/myuser/public/
1386 - device: //192.168.0.1/storage
1387 - file_system: cifs
1388 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
1389
Jiri Broulikb017f932017-03-31 13:55:36 +02001390NFS mount
1391
1392.. code-block:: yaml
1393
1394 linux:
1395 storage:
1396 enabled: true
1397 mount:
1398 nfs_glance:
1399 enabled: true
1400 path: /var/lib/glance/images
1401 device: 172.16.10.110:/var/nfs/glance
1402 file_system: nfs
1403 opts: rw,sync
1404
1405
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001406File swap configuration
Filip Pytlounf5383a42015-10-06 16:28:32 +02001407
1408.. code-block:: yaml
1409
1410 linux:
1411 storage:
1412 enabled: true
1413 swap:
1414 file:
1415 enabled: true
1416 engine: file
1417 device: /swapfile
1418 size: 1024
1419
Jakub Pavlik21ca2152017-02-27 22:21:09 +01001420Partition swap configuration
Lachlan Evenson30676512016-01-22 15:43:28 -08001421
1422.. code-block:: yaml
1423
1424 linux:
1425 storage:
1426 enabled: true
1427 swap:
1428 partition:
1429 enabled: true
1430 engine: partition
1431 device: /dev/vg0/swap
1432
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001433LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
1434
1435.. code-block:: yaml
1436
1437 parameters:
1438 linux:
1439 storage:
1440 mount:
1441 data:
Simon Pasquier376262a2016-11-16 15:21:51 +01001442 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +01001443 device: /dev/vg1/data
1444 file_system: ext4
1445 path: /mnt/data
1446 lvm:
1447 vg1:
1448 enabled: true
1449 devices:
1450 - /dev/sdb
1451 volume:
1452 data:
1453 size: 40G
1454 mount: ${linux:storage:mount:data}
1455
Jakub Pavlik4f742142017-08-08 15:05:50 +02001456Create partitions on disk. Specify size in MB. It expects empty
Piotr Krukd51911b2017-12-04 11:27:08 +01001457disk without any existing partitions. (set startsector=1, if you want to start partitions from 2048)
Jakub Pavlik4f742142017-08-08 15:05:50 +02001458
1459.. code-block:: yaml
1460
1461 linux:
1462 storage:
1463 disk:
1464 first_drive:
Piotr Krukd51911b2017-12-04 11:27:08 +01001465 startsector: 1
Jakub Pavlik4f742142017-08-08 15:05:50 +02001466 name: /dev/loop1
1467 type: gpt
1468 partitions:
1469 - size: 200 #size in MB
1470 type: fat32
1471 - size: 300 #size in MB
Jakub Pavlik8e2140a2017-08-14 23:29:57 +02001472 mkfs: True
1473 type: xfs
Jakub Pavlik4f742142017-08-08 15:05:50 +02001474 /dev/vda1:
1475 partitions:
1476 - size: 5
1477 type: ext2
1478 - size: 10
1479 type: ext4
Ales Komareka634f4b2016-10-02 13:11:04 +02001480
1481Multipath with Fujitsu Eternus DXL
1482
1483.. code-block:: yaml
1484
1485 parameters:
1486 linux:
1487 storage:
1488 multipath:
1489 enabled: true
1490 blacklist_devices:
1491 - /dev/sda
1492 - /dev/sdb
1493 backends:
1494 - fujitsu_eternus_dxl
1495
1496Multipath with Hitachi VSP 1000
1497
1498.. code-block:: yaml
1499
1500 parameters:
1501 linux:
1502 storage:
1503 multipath:
1504 enabled: true
1505 blacklist_devices:
1506 - /dev/sda
1507 - /dev/sdb
1508 backends:
1509 - hitachi_vsp1000
1510
1511Multipath with IBM Storwize
1512
1513.. code-block:: yaml
1514
1515 parameters:
1516 linux:
1517 storage:
1518 multipath:
1519 enabled: true
1520 blacklist_devices:
1521 - /dev/sda
1522 - /dev/sdb
1523 backends:
1524 - ibm_storwize
1525
1526Multipath with multiple backends
1527
1528.. code-block:: yaml
1529
1530 parameters:
1531 linux:
1532 storage:
1533 multipath:
1534 enabled: true
1535 blacklist_devices:
1536 - /dev/sda
1537 - /dev/sdb
1538 - /dev/sdc
1539 - /dev/sdd
1540 backends:
1541 - ibm_storwize
1542 - fujitsu_eternus_dxl
1543 - hitachi_vsp1000
1544
1545Disabled multipath (the default setup)
1546
1547.. code-block:: yaml
1548
1549 parameters:
1550 linux:
1551 storage:
1552 multipath:
1553 enabled: false
1554
Simon Pasquier375001e2017-01-26 13:22:33 +01001555Linux with local loopback device
1556
1557.. code-block:: yaml
1558
1559 linux:
1560 storage:
1561 loopback:
1562 disk1:
1563 file: /srv/disk1
1564 size: 50G
1565
Filip Pytlounb2c8f852016-11-21 17:03:43 +01001566External config generation
1567--------------------------
1568
1569You are able to use config support metadata between formulas and only generate
1570config files for external use, eg. docker, etc.
1571
1572.. code-block:: yaml
1573
1574 parameters:
1575 linux:
1576 system:
1577 config:
1578 pillar:
1579 jenkins:
1580 master:
1581 home: /srv/volumes/jenkins
1582 approved_scripts:
1583 - method java.net.URL openConnection
1584 credentials:
1585 - type: username_password
1586 scope: global
1587 id: test
1588 desc: Testing credentials
1589 username: test
1590 password: test
1591
Vladimir Ereminccf28842017-04-10 23:52:10 +03001592Netconsole Remote Kernel Logging
1593--------------------------------
1594
1595Netconsole logger could be configured for configfs-enabled kernels
1596(`CONFIG_NETCONSOLE_DYNAMIC` should be enabled). Configuration applies both in
1597runtime (if network is already configured), and on-boot after interface
1598initialization. Notes:
1599
1600 * receiver could be located only in same L3 domain
1601 (or you need to configure gateway MAC manually)
1602 * receiver's MAC is detected only on configuration time
1603 * using broadcast MAC is not recommended
1604
1605.. code-block:: yaml
1606
1607 parameters:
1608 linux:
1609 system:
1610 netconsole:
1611 enabled: true
1612 port: 514 (optional)
1613 loglevel: debug (optional)
1614 target:
1615 192.168.0.1:
1616 interface: bond0
1617 mac: "ff:ff:ff:ff:ff:ff" (optional)
Ales Komareka634f4b2016-10-02 13:11:04 +02001618
Filip Pytlounf5383a42015-10-06 16:28:32 +02001619Usage
1620=====
1621
1622Set mtu of network interface eth0 to 1400
1623
1624.. code-block:: bash
1625
1626 ip link set dev eth0 mtu 1400
1627
1628Read more
1629=========
1630
1631* https://www.archlinux.org/
1632* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01001633
1634Documentation and Bugs
1635======================
1636
1637To learn how to install and update salt-formulas, consult the documentation
1638available online at:
1639
1640 http://salt-formulas.readthedocs.io/
1641
1642In the unfortunate event that bugs are discovered, they should be reported to
1643the appropriate issue tracker. Use Github issue tracker for specific salt
1644formula:
1645
1646 https://github.com/salt-formulas/salt-formula-linux/issues
1647
1648For feature requests, bug reports or blueprints affecting entire ecosystem,
1649use Launchpad salt-formulas project:
1650
1651 https://launchpad.net/salt-formulas
1652
1653You can also join salt-formulas-users team and subscribe to mailing list:
1654
1655 https://launchpad.net/~salt-formulas-users
1656
1657Developers wishing to work on the salt-formulas projects should always base
1658their work on master branch and submit pull request against specific formula.
1659
1660 https://github.com/salt-formulas/salt-formula-linux
1661
1662Any questions or feedback is always welcome so feel free to join our IRC
1663channel:
1664
1665 #salt-formulas @ irc.freenode.net