blob: 22b8b1a33f003f0711f22d4c8670aa31b9c1c5d3 [file] [log] [blame]
Filip Pytlounf5383a42015-10-06 16:28:32 +02001=====
2Linux
3=====
4
5Linux Operating Systems.
6
7* Ubuntu
8* CentOS
9* RedHat
10* Fedora
11* Arch
12
13Sample pillars
14==============
15
16Linux system
17------------
18
19Basic Linux box
20
21.. code-block:: yaml
22
23 linux:
24 system:
25 enabled: true
26 name: 'node1'
27 domain: 'domain.com'
28 cluster: 'system'
29 environment: prod
30 timezone: 'Europe/Prague'
31 utc: true
32
Petr Michalec1c4c8d82017-02-28 19:09:21 +010033Linux with system users, some with password set
Filip Pytlounf5383a42015-10-06 16:28:32 +020034
35.. code-block:: yaml
36
37 linux:
38 system:
39 ...
40 user:
41 jdoe:
42 name: 'jdoe'
43 enabled: true
44 sudo: true
45 shell: /bin/bash
46 full_name: 'Jonh Doe'
47 home: '/home/jdoe'
48 email: 'jonh@doe.com'
49 jsmith:
50 name: 'jsmith'
51 enabled: true
52 full_name: 'Password'
53 home: '/home/jsmith'
54 password: userpassword
55
Petr Michalec1c4c8d82017-02-28 19:09:21 +010056Configure sudo for users and groups under ``/etc/sudoers.d/``.
57This ways ``linux.system.sudo`` pillar map to actual sudo attributes:
58
59.. code-block:: jinja
60 # simplified template:
61 Cmds_Alias {{ alias }}={{ commands }}
62 {{ user }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
63 %{{ group }} {{ hosts }}=({{ runas }}) NOPASSWD: {{ commands }}
64
65 # when rendered:
66 saltuser1 ALL=(ALL) NOPASSWD: ALL
67
68
69.. code-block:: yaml
70 linux:
71 system:
72 sudo:
73 enabled: true
74 alias:
75 host:
76 LOCAL:
77 - localhost
78 PRODUCTION:
79 - db1
80 - db2
81 runas:
82 DBA:
83 - postgres
84 - mysql
85 SALT:
86 - root
87 command:
88 # Note: This is not 100% safe when ALL keyword is used, user still may modify configs and hide his actions.
89 # Best practice is to specify full list of commands user is allowed to run.
90 SUPPORT_RESTRICTED:
91 - /bin/vi /etc/sudoers*
92 - /bin/vim /etc/sudoers*
93 - /bin/nano /etc/sudoers*
94 - /bin/emacs /etc/sudoers*
95 - /bin/su - root
96 - /bin/su -
97 - /bin/su
98 - /usr/sbin/visudo
99 SUPPORT_SHELLS:
100 - /bin/sh
101 - /bin/ksh
102 - /bin/bash
103 - /bin/rbash
104 - /bin/dash
105 - /bin/zsh
106 - /bin/csh
107 - /bin/fish
108 - /bin/tcsh
109 - /usr/bin/login
110 - /usr/bin/su
111 - /usr/su
112 ALL_SALT_SAFE:
113 - /usr/bin/salt state*
114 - /usr/bin/salt service*
115 - /usr/bin/salt pillar*
116 - /usr/bin/salt grains*
117 - /usr/bin/salt saltutil*
118 - /usr/bin/salt-call state*
119 - /usr/bin/salt-call service*
120 - /usr/bin/salt-call pillar*
121 - /usr/bin/salt-call grains*
122 - /usr/bin/salt-call saltutil*
123 SALT_TRUSTED:
124 - /usr/bin/salt*
125 users:
126 # saltuser1 with default values: saltuser1 ALL=(ALL) NOPASSWD: ALL
127 saltuser1: {}
128 saltuser2:
129 hosts:
130 - LOCAL
131 # User Alias DBA
132 DBA:
133 hosts:
134 - ALL
135 commands:
136 - ALL_SALT_SAFE
137 groups:
138 db-ops:
139 hosts:
140 - ALL
141 - '!PRODUCTION'
142 runas:
143 - DBA
144 commands:
145 - /bin/cat *
146 - /bin/less *
147 - /bin/ls *
148 salt-ops:
149 hosts:
150 - 'ALL'
151 runas:
152 - SALT
153 commands:
154 - SUPPORT_SHELLS
155 salt-ops-2nd:
156 name: salt-ops
157 nopasswd: false
158 runas:
159 - DBA
160 commands:
161 - ALL
162 - '!SUPPORT_SHELLS'
163 - '!SUPPORT_RESTRICTED'
164
Filip Pytlounf5383a42015-10-06 16:28:32 +0200165Linux with package, latest version
166
167.. code-block:: yaml
168
169 linux:
170 system:
171 ...
172 package:
173 package-name:
174 version: latest
175
176Linux with package from certail repo, version with no upgrades
177
178.. code-block:: yaml
179
180 linux:
181 system:
182 ...
183 package:
184 package-name:
185 version: 2132.323
186 repo: 'custom-repo'
187 hold: true
188
189Linux with package from certail repo, version with no GPG verification
190
191.. code-block:: yaml
192
193 linux:
194 system:
195 ...
196 package:
197 package-name:
198 version: 2132.323
199 repo: 'custom-repo'
200 verify: false
201
Bruno Binet69a9d8d2017-02-16 22:34:32 +0100202Linux with autoupdates (automatically install security package updates)
203
204.. code-block:: yaml
205
206 linux:
207 system:
208 ...
209 autoupdates:
210 enabled: true
211 mail: root@localhost
212 mail_only_on_error: true
213 remove_unused_dependencies: false
214 automatic_reboot: true
215 automatic_reboot_time: "02:00"
216
Filip Pytlounf5383a42015-10-06 16:28:32 +0200217Linux with cron jobs
218
219.. code-block:: yaml
220
221 linux:
222 system:
223 ...
224 job:
225 cmd1:
226 command: '/cmd/to/run'
227 enabled: true
228 user: 'root'
229 hour: 2
230 minute: 0
231
Filip Pytlound0a29e72015-11-30 15:23:34 +0100232Linux security limits (limit sensu user memory usage to max 1GB):
233
234.. code-block:: yaml
235
236 linux:
237 system:
238 ...
239 limit:
240 sensu:
241 enabled: true
242 domain: sensu
243 limits:
244 - type: hard
245 item: as
246 value: 1000000
247
Filip Pytloun7fee0542015-10-15 11:19:24 +0200248Enable autologin on tty1 (may work only for Ubuntu 14.04):
249
250.. code-block:: yaml
251
252 linux:
253 system:
254 console:
255 tty1:
256 autologin: root
Filip Pytloun281d0202016-01-29 14:03:51 +0100257 # Enable serial console
258 ttyS0:
259 autologin: root
260 rate: 115200
261 term: xterm
Filip Pytloun7fee0542015-10-15 11:19:24 +0200262
263To disable set autologin to `false`.
264
Filip Pytloun7731b852016-02-01 11:13:47 +0100265Set ``policy-rc.d`` on Debian-based systems. Action can be any available
266command in ``while true`` loop and ``case`` context.
267Following will disallow dpkg to stop/start services for cassandra package automatically:
268
269.. code-block:: yaml
270
271 linux:
272 system:
273 policyrcd:
274 - package: cassandra
275 action: exit 101
276 - package: '*'
277 action: switch
278
Filip Pytlounc49445a2016-04-04 14:23:20 +0200279Set system locales:
280
281.. code-block:: yaml
282
283 linux:
284 system:
285 locale:
286 en_US.UTF-8:
287 default: true
Filip Pytlounee1745f2016-04-04 17:39:41 +0200288 "cs_CZ.UTF-8 UTF-8":
Filip Pytlounc49445a2016-04-04 14:23:20 +0200289 enabled: true
290
Filip Pytloun281034a2016-01-04 18:06:22 +0100291Kernel
292~~~~~~
293
294Install always up to date LTS kernel and headers from Ubuntu trusty:
295
296.. code-block:: yaml
297
298 linux:
299 system:
300 kernel:
301 type: generic
302 lts: trusty
303 headers: true
304
Tomáš Kukrálba35b212017-02-15 17:59:46 +0100305Load kernel modules and add them to `/etc/modules`:
306
307.. code-block:: yaml
308
309 linux:
310 system:
311 kernel:
312 modules:
313 - nf_conntrack
314 - tp_smapi
315 - 8021q
316
Filip Pytloun281034a2016-01-04 18:06:22 +0100317Install specific kernel version and ensure all other kernel packages are
318not present. Also install extra modules and headers for this kernel:
319
320.. code-block:: yaml
321
322 linux:
323 system:
324 kernel:
325 type: generic
326 extra: true
327 headers: true
328 version: 4.2.0-22
329
Jakub Pavlik32c2cb02016-01-29 12:45:29 +0100330Systcl kernel parameters
331
332.. code-block:: yaml
333
334 linux:
335 system:
336 kernel:
337 sysctl:
338 net.ipv4.tcp_keepalive_intvl: 3
339 net.ipv4.tcp_keepalive_time: 30
340 net.ipv4.tcp_keepalive_probes: 8
341
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100342
343CPU
344~~~
345
346Disable ondemand cpu mode service:
347
348.. code-block:: yaml
349
350 linux:
351 system:
352 cpu:
353 governor: performance
354
Jakub Pavlikb148c8c2017-02-12 21:30:48 +0100355Huge Pages
356~~~~~~~~~~~~
357
358Huge Pages give a performance boost to applications that intensively deal
359with memory allocation/deallocation by decreasing memory fragmentation.
360
361.. code-block:: yaml
362
363 linux:
364 system:
365 kernel:
366 hugepages:
367 small:
368 size: 2M
369 count: 107520
370 mount_point: /mnt/hugepages_2MB
371 mount: false/true # default false
372 large:
373 default: true # default automatically mounted
374 size: 1G
375 count: 210
376 mount_point: /mnt/hugepages_1GB
377
378Note: not recommended to use both pagesizes in concurrently.
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100379
Jakub Pavlik5398d872017-02-13 22:30:47 +0100380Intel SR-IOV
381~~~~~~~~~~~~
382
383PCI-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.
384
385.. code-block:: yaml
386
387 linux:
388 system:
389 kernel:
390 sriov: True
391 unsafe_interrupts: False # Default is false. for older platforms and AMD we need to add interrupt remapping workaround
392 rc:
393 local: |
394 #!/bin/sh -e
395 # Enable 7 VF on eth1
396 echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
397 exit 0
398
Jakub Pavlik6c9ead12017-02-16 21:53:13 +0100399Isolate CPU options
400~~~~~~~~~~~~~~~~~~~
401
402Remove the specified CPUs, as defined by the cpu_number values, from the general kernel
403SMP balancing and scheduler algroithms. The only way to move a process onto or off an
404"isolated" CPU is via the CPU affinity syscalls. cpu_number begins at 0, so the
405maximum value is 1 less than the number of CPUs on the system.
406
407.. code-block:: yaml
408
409 linux:
410 system:
411 kernel:
412 isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0
Jiri Broulikf8f55a22017-01-26 14:36:46 +0100413
Filip Pytlounf5383a42015-10-06 16:28:32 +0200414Repositories
415~~~~~~~~~~~~
416
417RedHat based Linux with additional OpenStack repo
418
419.. code-block:: yaml
420
421 linux:
422 system:
423 ...
424 repo:
425 rdo-icehouse:
426 enabled: true
427 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
428 pgpcheck: 0
429
430Ensure system repository to use czech Debian mirror (``default: true``)
431Also pin it's packages with priority 900.
432
433.. code-block:: yaml
434
435 linux:
436 system:
437 repo:
438 debian:
439 default: true
440 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
441 # Import signing key from URL if needed
442 key_url: "http://dummy.com/public.gpg"
443 pin:
444 - pin: 'origin "ftp.cz.debian.org"'
445 priority: 900
446 package: '*'
447
Jakub Pavlik78859382016-01-21 11:26:39 +0100448rc.local example
449
450.. code-block:: yaml
451
452 linux:
453 system:
454 rc:
455 local: |
456 #!/bin/sh -e
457 #
458 # rc.local
459 #
460 # This script is executed at the end of each multiuser runlevel.
461 # Make sure that the script will "exit 0" on success or any other
462 # value on error.
463 #
464 # In order to enable or disable this script just change the execution
465 # bits.
466 #
467 # By default this script does nothing.
468 exit 0
469
Filip Pytloun1f40dac2016-01-22 15:52:57 +0100470Prompt
471~~~~~~
472
473Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every
474user can have different prompt.
475
476.. code-block:: yaml
477
478 linux:
479 system:
480 prompt:
481 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\\]
482 default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w]
483
484On Debian systems to set prompt system-wide it's necessary to remove setting
485PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from
486``/etc/skel/.bashrc``). This formula will do this automatically, but will not
Filip Pytlound9b68da2016-01-22 15:58:41 +0100487touch existing user's ``~/.bashrc`` files except root.
Jakub Pavlik78859382016-01-21 11:26:39 +0100488
Filip Pytlouneef11c12016-03-25 11:00:23 +0100489Bash
490~~~~
491
492Fix bash configuration to preserve history across sessions (like ZSH does by
493default).
494
495.. code-block:: yaml
496
497 linux:
498 system:
499 bash:
500 preserve_history: true
501
Filip Pytloune874dfb2016-01-22 16:57:34 +0100502Message of the day
503~~~~~~~~~~~~~~~~~~
504
505``pam_motd`` from package ``update-motd`` is used for dynamic messages of the
506day. Setting custom motd will cleanup existing ones.
507
508.. code-block:: yaml
509
510 linux:
511 system:
512 motd:
513 - release: |
514 #!/bin/sh
515 [ -r /etc/lsb-release ] && . /etc/lsb-release
516
517 if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
518 # Fall back to using the very slow lsb_release utility
519 DISTRIB_DESCRIPTION=$(lsb_release -s -d)
520 fi
521
522 printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"
523 - warning: |
524 #!/bin/sh
525 printf "This is [company name] network.\n"
526 printf "Unauthorized access strictly prohibited.\n"
527
Filip Pytloun2f70b492016-02-19 15:55:25 +0100528RHEL / CentOS
Filip Pytloun8296bb92016-02-19 18:42:09 +0100529^^^^^^^^^^^^^
Filip Pytloun2f70b492016-02-19 15:55:25 +0100530
531Unfortunately ``update-motd`` is currently not available for RHEL so there's
532no native support for dynamic motd.
533You can still set static one, only pillar structure differs:
534
535.. code-block:: yaml
536
537 linux:
538 system:
539 motd: |
540 This is [company name] network.
541 Unauthorized access strictly prohibited.
542
Filip Pytloun8296bb92016-02-19 18:42:09 +0100543Haveged
544~~~~~~~
545
546If you are running headless server and are low on entropy, it may be a good
547idea to setup Haveged.
548
549.. code-block:: yaml
550
551 linux:
552 system:
553 haveged:
554 enabled: true
555
Filip Pytlounf5383a42015-10-06 16:28:32 +0200556Linux network
557-------------
558
559Linux with network manager
560
561.. code-block:: yaml
562
563 linux:
564 network:
565 enabled: true
566 network_manager: true
567
568Linux with default static network interfaces, default gateway interface and DNS servers
569
570.. code-block:: yaml
571
572 linux:
573 network:
574 enabled: true
575 interface:
576 eth0:
577 enabled: true
578 type: eth
579 address: 192.168.0.102
580 netmask: 255.255.255.0
581 gateway: 192.168.0.1
582 name_servers:
583 - 8.8.8.8
584 - 8.8.4.4
585 mtu: 1500
586
jan kaufman6d30adf2016-01-18 17:30:12 +0100587Linux with bonded interfaces and disabled NetworkManager
Filip Pytlounf5383a42015-10-06 16:28:32 +0200588
589.. code-block:: yaml
590
591 linux:
592 network:
593 enabled: true
594 interface:
595 eth0:
596 type: eth
597 ...
598 eth1:
599 type: eth
600 ...
601 bond0:
602 enabled: true
603 type: bond
604 address: 192.168.0.102
605 netmask: 255.255.255.0
606 mtu: 1500
607 use_in:
608 - interface: ${linux:interface:eth0}
609 - interface: ${linux:interface:eth0}
jan kaufman6d30adf2016-01-18 17:30:12 +0100610 network_manager:
611 disable: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200612
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100613Linux with vlan interface_params
614
615.. code-block:: yaml
616
617 linux:
618 network:
619 enabled: true
620 interface:
621 vlan69:
622 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +0100623 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100624 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100625
Filip Pytlounf5383a42015-10-06 16:28:32 +0200626Linux with wireless interface parameters
627
628.. code-block:: yaml
629
630 linux:
631 network:
632 enabled: true
633 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100634 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200635 interface:
636 wlan0:
637 type: eth
638 wireless:
639 essid: example
640 key: example_key
641 security: wpa
642 priority: 1
643
644Linux networks with routes defined
645
646.. code-block:: yaml
647
648 linux:
649 network:
650 enabled: true
651 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100652 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200653 interface:
654 eth0:
655 type: eth
656 route:
657 default:
658 address: 192.168.0.123
659 netmask: 255.255.255.0
660 gateway: 192.168.0.1
661
662Native Linux Bridges
663
664.. code-block:: yaml
665
666 linux:
667 network:
668 interface:
669 eth1:
670 enabled: true
671 type: eth
672 proto: manual
673 up_cmds:
674 - ip address add 0/0 dev $IFACE
675 - ip link set $IFACE up
676 down_cmds:
677 - ip link set $IFACE down
678 br-ex:
679 enabled: true
680 type: bridge
681 address: ${linux:network:host:public_local:address}
682 netmask: 255.255.255.0
683 use_interfaces:
684 - eth1
685
686OpenVswitch Bridges
687
688.. code-block:: yaml
689
690 linux:
691 network:
692 bridge: openvswitch
693 interface:
694 eth1:
695 enabled: true
696 type: eth
697 proto: manual
698 up_cmds:
699 - ip address add 0/0 dev $IFACE
700 - ip link set $IFACE up
701 down_cmds:
702 - ip link set $IFACE down
703 br-ex:
704 enabled: true
705 type: bridge
706 address: ${linux:network:host:public_local:address}
707 netmask: 255.255.255.0
708 use_interfaces:
709 - eth1
710
711Linux with proxy
712
713.. code-block:: yaml
714
715 linux:
716 network:
717 ...
718 proxy:
719 host: proxy.domain.com
720 port: 3128
721
722Linux with hosts
723
Filip Pytloun86506fe2017-01-26 14:36:16 +0100724Parameter purge_hosts will enforce whole /etc/hosts file, removing entries
725that are not defined in model except defaults for both IPv4 and IPv6 localhost
726and hostname + fqdn.
727It's good to use this option if you want to ensure /etc/hosts is always in a
728clean state however it's not enabled by default for safety.
729
Filip Pytlounf5383a42015-10-06 16:28:32 +0200730.. code-block:: yaml
731
732 linux:
733 network:
734 ...
Filip Pytloun86506fe2017-01-26 14:36:16 +0100735 purge_hosts: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200736 host:
Filip Pytloun86506fe2017-01-26 14:36:16 +0100737 # No need to define this one if purge_hosts is true
738 hostname:
739 address: 127.0.1.1
740 names:
741 - ${linux:network:fqdn}
742 - ${linux:network:hostname}
Filip Pytlounf5383a42015-10-06 16:28:32 +0200743 node1:
744 address: 192.168.10.200
745 names:
746 - node2.domain.com
747 - service2.domain.com
748 node2:
749 address: 192.168.10.201
750 names:
751 - node2.domain.com
752 - service2.domain.com
753
Filip Pytloun86506fe2017-01-26 14:36:16 +0100754
Filip Pytlounde9bea52016-01-11 15:39:10 +0100755Setup resolv.conf, nameservers, domain and search domains
756
757.. code-block:: yaml
758
759 linux:
760 network:
761 resolv:
762 dns:
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100763 - 8.8.4.4
764 - 8.8.8.8
Filip Pytlounde9bea52016-01-11 15:39:10 +0100765 domain: my.example.com
766 search:
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100767 - my.example.com
768 - example.com
Marek Celoudf6cd1922016-12-05 13:39:49 +0100769 options:
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100770 - ndots: 5
771 - timeout: 2
772 - attempts: 2
Filip Pytlounde9bea52016-01-11 15:39:10 +0100773
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100774DPDK OVS interfaces
775--------------------
776
777**DPDK OVS NIC**
778
779.. code-block:: yaml
780
781 linux:
782 network:
783 bridge: openvswitch
784 dpdk:
785 enabled: true
786 driver: uio/vfio-pci
787 openvswitch:
788 pmd_cpu_mask: "0x6"
789 dpdk_socket_mem: "1024,1024"
790 dpdk_lcore_mask: "0x400"
791 memory_channels: 2
792 interface:
793 dpkd0:
794 name: ${_param:dpdk_nic}
795 pci: 0000:06:00.0
796 driver: igb_uio/vfio
797 enabled: true
798 type: dpdk_ovs_port
799 n_rxq: 2
800 bridge: br-prv
Jakub Pavlikaa759062017-03-13 15:57:26 +0100801 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100802 br-prv:
803 enabled: true
804 type: dpdk_ovs_bridge
805
806**DPDK OVS Bond**
807
808.. code-block:: yaml
809
810 linux:
811 network:
812 bridge: openvswitch
813 dpdk:
814 enabled: true
815 driver: uio/vfio-pci
816 openvswitch:
817 pmd_cpu_mask: "0x6"
818 dpdk_socket_mem: "1024,1024"
819 dpdk_lcore_mask: "0x400"
820 memory_channels: 2
821 interface:
822 dpdk_second_nic:
823 name: ${_param:primary_second_nic}
824 pci: 0000:06:00.0
825 driver: igb_uio/vfio
826 bond: dpdkbond0
827 enabled: true
828 type: dpdk_ovs_port
829 n_rxq: 2
Jakub Pavlikaa759062017-03-13 15:57:26 +0100830 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100831 dpdk_first_nic:
832 name: ${_param:primary_first_nic}
833 pci: 0000:05:00.0
834 driver: igb_uio/vfio
835 bond: dpdkbond0
836 enabled: true
837 type: dpdk_ovs_port
838 n_rxq: 2
Jakub Pavlikaa759062017-03-13 15:57:26 +0100839 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100840 dpdkbond0:
841 enabled: true
842 bridge: br-prv
843 type: dpdk_ovs_bond
844 mode: active-backup
845 br-prv:
846 enabled: true
847 type: dpdk_ovs_bridge
848
Jakub Pavlikaa759062017-03-13 15:57:26 +0100849**DPDK OVS bridge for VXLAN**
850
851If VXLAN is used as tenant segmentation then ip address must be set on br-prv
852
853.. code-block:: yaml
854
855 linux:
856 network:
857 ...
858 interface:
859 br-prv:
860 enabled: true
861 type: dpdk_ovs_bridge
862 address: 192.168.50.0
863 netmask: 255.255.255.0
864 mtu: 9000
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100865
866Linux storage
867-------------
Filip Pytlounf5383a42015-10-06 16:28:32 +0200868
869Linux with mounted Samba
870
871.. code-block:: yaml
872
873 linux:
874 storage:
875 enabled: true
876 mount:
877 samba1:
Simon Pasquier376262a2016-11-16 15:21:51 +0100878 - enabled: true
Filip Pytlounf5383a42015-10-06 16:28:32 +0200879 - path: /media/myuser/public/
880 - device: //192.168.0.1/storage
881 - file_system: cifs
882 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
883
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100884File swap configuration
Filip Pytlounf5383a42015-10-06 16:28:32 +0200885
886.. code-block:: yaml
887
888 linux:
889 storage:
890 enabled: true
891 swap:
892 file:
893 enabled: true
894 engine: file
895 device: /swapfile
896 size: 1024
897
Jakub Pavlik21ca2152017-02-27 22:21:09 +0100898Partition swap configuration
Lachlan Evenson30676512016-01-22 15:43:28 -0800899
900.. code-block:: yaml
901
902 linux:
903 storage:
904 enabled: true
905 swap:
906 partition:
907 enabled: true
908 engine: partition
909 device: /dev/vg0/swap
910
Filip Pytlounc8a001a2015-12-15 14:09:19 +0100911LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
912
913.. code-block:: yaml
914
915 parameters:
916 linux:
917 storage:
918 mount:
919 data:
Simon Pasquier376262a2016-11-16 15:21:51 +0100920 enabled: true
Filip Pytlounc8a001a2015-12-15 14:09:19 +0100921 device: /dev/vg1/data
922 file_system: ext4
923 path: /mnt/data
924 lvm:
925 vg1:
926 enabled: true
927 devices:
928 - /dev/sdb
929 volume:
930 data:
931 size: 40G
932 mount: ${linux:storage:mount:data}
933
Ales Komareka634f4b2016-10-02 13:11:04 +0200934
935Multipath with Fujitsu Eternus DXL
936
937.. code-block:: yaml
938
939 parameters:
940 linux:
941 storage:
942 multipath:
943 enabled: true
944 blacklist_devices:
945 - /dev/sda
946 - /dev/sdb
947 backends:
948 - fujitsu_eternus_dxl
949
950Multipath with Hitachi VSP 1000
951
952.. code-block:: yaml
953
954 parameters:
955 linux:
956 storage:
957 multipath:
958 enabled: true
959 blacklist_devices:
960 - /dev/sda
961 - /dev/sdb
962 backends:
963 - hitachi_vsp1000
964
965Multipath with IBM Storwize
966
967.. code-block:: yaml
968
969 parameters:
970 linux:
971 storage:
972 multipath:
973 enabled: true
974 blacklist_devices:
975 - /dev/sda
976 - /dev/sdb
977 backends:
978 - ibm_storwize
979
980Multipath with multiple backends
981
982.. code-block:: yaml
983
984 parameters:
985 linux:
986 storage:
987 multipath:
988 enabled: true
989 blacklist_devices:
990 - /dev/sda
991 - /dev/sdb
992 - /dev/sdc
993 - /dev/sdd
994 backends:
995 - ibm_storwize
996 - fujitsu_eternus_dxl
997 - hitachi_vsp1000
998
999Disabled multipath (the default setup)
1000
1001.. code-block:: yaml
1002
1003 parameters:
1004 linux:
1005 storage:
1006 multipath:
1007 enabled: false
1008
Simon Pasquier375001e2017-01-26 13:22:33 +01001009Linux with local loopback device
1010
1011.. code-block:: yaml
1012
1013 linux:
1014 storage:
1015 loopback:
1016 disk1:
1017 file: /srv/disk1
1018 size: 50G
1019
Filip Pytlounb2c8f852016-11-21 17:03:43 +01001020External config generation
1021--------------------------
1022
1023You are able to use config support metadata between formulas and only generate
1024config files for external use, eg. docker, etc.
1025
1026.. code-block:: yaml
1027
1028 parameters:
1029 linux:
1030 system:
1031 config:
1032 pillar:
1033 jenkins:
1034 master:
1035 home: /srv/volumes/jenkins
1036 approved_scripts:
1037 - method java.net.URL openConnection
1038 credentials:
1039 - type: username_password
1040 scope: global
1041 id: test
1042 desc: Testing credentials
1043 username: test
1044 password: test
1045
Ales Komareka634f4b2016-10-02 13:11:04 +02001046
Filip Pytlounf5383a42015-10-06 16:28:32 +02001047Usage
1048=====
1049
1050Set mtu of network interface eth0 to 1400
1051
1052.. code-block:: bash
1053
1054 ip link set dev eth0 mtu 1400
1055
1056Read more
1057=========
1058
1059* https://www.archlinux.org/
1060* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu
Filip Pytloun018f8712017-02-02 13:02:03 +01001061
1062Documentation and Bugs
1063======================
1064
1065To learn how to install and update salt-formulas, consult the documentation
1066available online at:
1067
1068 http://salt-formulas.readthedocs.io/
1069
1070In the unfortunate event that bugs are discovered, they should be reported to
1071the appropriate issue tracker. Use Github issue tracker for specific salt
1072formula:
1073
1074 https://github.com/salt-formulas/salt-formula-linux/issues
1075
1076For feature requests, bug reports or blueprints affecting entire ecosystem,
1077use Launchpad salt-formulas project:
1078
1079 https://launchpad.net/salt-formulas
1080
1081You can also join salt-formulas-users team and subscribe to mailing list:
1082
1083 https://launchpad.net/~salt-formulas-users
1084
1085Developers wishing to work on the salt-formulas projects should always base
1086their work on master branch and submit pull request against specific formula.
1087
1088 https://github.com/salt-formulas/salt-formula-linux
1089
1090Any questions or feedback is always welcome so feel free to join our IRC
1091channel:
1092
1093 #salt-formulas @ irc.freenode.net