Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
| 2 | ===== |
| 3 | Linux |
| 4 | ===== |
| 5 | |
| 6 | Linux Operating Systems. |
| 7 | |
| 8 | * Ubuntu |
| 9 | * CentOS |
| 10 | * RedHat |
| 11 | * Fedora |
| 12 | * Arch |
| 13 | |
| 14 | Sample pillars |
| 15 | ============== |
| 16 | |
| 17 | Linux system |
| 18 | ------------ |
| 19 | |
| 20 | Basic 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 | |
| 34 | Linux with system users, sowe with password set |
| 35 | |
| 36 | .. code-block:: yaml |
| 37 | |
| 38 | linux: |
| 39 | system: |
| 40 | ... |
| 41 | user: |
| 42 | jdoe: |
| 43 | name: 'jdoe' |
| 44 | enabled: true |
| 45 | sudo: true |
| 46 | shell: /bin/bash |
| 47 | full_name: 'Jonh Doe' |
| 48 | home: '/home/jdoe' |
| 49 | email: 'jonh@doe.com' |
| 50 | jsmith: |
| 51 | name: 'jsmith' |
| 52 | enabled: true |
| 53 | full_name: 'Password' |
| 54 | home: '/home/jsmith' |
| 55 | password: userpassword |
| 56 | |
| 57 | Linux with package, latest version |
| 58 | |
| 59 | .. code-block:: yaml |
| 60 | |
| 61 | linux: |
| 62 | system: |
| 63 | ... |
| 64 | package: |
| 65 | package-name: |
| 66 | version: latest |
| 67 | |
| 68 | Linux with package from certail repo, version with no upgrades |
| 69 | |
| 70 | .. code-block:: yaml |
| 71 | |
| 72 | linux: |
| 73 | system: |
| 74 | ... |
| 75 | package: |
| 76 | package-name: |
| 77 | version: 2132.323 |
| 78 | repo: 'custom-repo' |
| 79 | hold: true |
| 80 | |
| 81 | Linux with package from certail repo, version with no GPG verification |
| 82 | |
| 83 | .. code-block:: yaml |
| 84 | |
| 85 | linux: |
| 86 | system: |
| 87 | ... |
| 88 | package: |
| 89 | package-name: |
| 90 | version: 2132.323 |
| 91 | repo: 'custom-repo' |
| 92 | verify: false |
| 93 | |
| 94 | Linux with cron jobs |
| 95 | |
| 96 | .. code-block:: yaml |
| 97 | |
| 98 | linux: |
| 99 | system: |
| 100 | ... |
| 101 | job: |
| 102 | cmd1: |
| 103 | command: '/cmd/to/run' |
| 104 | enabled: true |
| 105 | user: 'root' |
| 106 | hour: 2 |
| 107 | minute: 0 |
| 108 | |
Filip Pytloun | d0a29e7 | 2015-11-30 15:23:34 +0100 | [diff] [blame] | 109 | Linux security limits (limit sensu user memory usage to max 1GB): |
| 110 | |
| 111 | .. code-block:: yaml |
| 112 | |
| 113 | linux: |
| 114 | system: |
| 115 | ... |
| 116 | limit: |
| 117 | sensu: |
| 118 | enabled: true |
| 119 | domain: sensu |
| 120 | limits: |
| 121 | - type: hard |
| 122 | item: as |
| 123 | value: 1000000 |
| 124 | |
Filip Pytloun | 7fee054 | 2015-10-15 11:19:24 +0200 | [diff] [blame] | 125 | Enable autologin on tty1 (may work only for Ubuntu 14.04): |
| 126 | |
| 127 | .. code-block:: yaml |
| 128 | |
| 129 | linux: |
| 130 | system: |
| 131 | console: |
| 132 | tty1: |
| 133 | autologin: root |
Filip Pytloun | 281d020 | 2016-01-29 14:03:51 +0100 | [diff] [blame] | 134 | # Enable serial console |
| 135 | ttyS0: |
| 136 | autologin: root |
| 137 | rate: 115200 |
| 138 | term: xterm |
Filip Pytloun | 7fee054 | 2015-10-15 11:19:24 +0200 | [diff] [blame] | 139 | |
| 140 | To disable set autologin to `false`. |
| 141 | |
Filip Pytloun | 7731b85 | 2016-02-01 11:13:47 +0100 | [diff] [blame] | 142 | Set ``policy-rc.d`` on Debian-based systems. Action can be any available |
| 143 | command in ``while true`` loop and ``case`` context. |
| 144 | Following will disallow dpkg to stop/start services for cassandra package automatically: |
| 145 | |
| 146 | .. code-block:: yaml |
| 147 | |
| 148 | linux: |
| 149 | system: |
| 150 | policyrcd: |
| 151 | - package: cassandra |
| 152 | action: exit 101 |
| 153 | - package: '*' |
| 154 | action: switch |
| 155 | |
Filip Pytloun | c49445a | 2016-04-04 14:23:20 +0200 | [diff] [blame] | 156 | Set system locales: |
| 157 | |
| 158 | .. code-block:: yaml |
| 159 | |
| 160 | linux: |
| 161 | system: |
| 162 | locale: |
| 163 | en_US.UTF-8: |
| 164 | default: true |
Filip Pytloun | ee1745f | 2016-04-04 17:39:41 +0200 | [diff] [blame] | 165 | "cs_CZ.UTF-8 UTF-8": |
Filip Pytloun | c49445a | 2016-04-04 14:23:20 +0200 | [diff] [blame] | 166 | enabled: true |
| 167 | |
Filip Pytloun | 281034a | 2016-01-04 18:06:22 +0100 | [diff] [blame] | 168 | Kernel |
| 169 | ~~~~~~ |
| 170 | |
| 171 | Install always up to date LTS kernel and headers from Ubuntu trusty: |
| 172 | |
| 173 | .. code-block:: yaml |
| 174 | |
| 175 | linux: |
| 176 | system: |
| 177 | kernel: |
| 178 | type: generic |
| 179 | lts: trusty |
| 180 | headers: true |
| 181 | |
| 182 | Install specific kernel version and ensure all other kernel packages are |
| 183 | not present. Also install extra modules and headers for this kernel: |
| 184 | |
| 185 | .. code-block:: yaml |
| 186 | |
| 187 | linux: |
| 188 | system: |
| 189 | kernel: |
| 190 | type: generic |
| 191 | extra: true |
| 192 | headers: true |
| 193 | version: 4.2.0-22 |
| 194 | |
Jakub Pavlik | 32c2cb0 | 2016-01-29 12:45:29 +0100 | [diff] [blame] | 195 | Systcl kernel parameters |
| 196 | |
| 197 | .. code-block:: yaml |
| 198 | |
| 199 | linux: |
| 200 | system: |
| 201 | kernel: |
| 202 | sysctl: |
| 203 | net.ipv4.tcp_keepalive_intvl: 3 |
| 204 | net.ipv4.tcp_keepalive_time: 30 |
| 205 | net.ipv4.tcp_keepalive_probes: 8 |
| 206 | |
Jiri Broulik | f8f55a2 | 2017-01-26 14:36:46 +0100 | [diff] [blame] | 207 | |
| 208 | CPU |
| 209 | ~~~ |
| 210 | |
| 211 | Disable ondemand cpu mode service: |
| 212 | |
| 213 | .. code-block:: yaml |
| 214 | |
| 215 | linux: |
| 216 | system: |
| 217 | cpu: |
| 218 | governor: performance |
| 219 | |
Jakub Pavlik | b148c8c | 2017-02-12 21:30:48 +0100 | [diff] [blame^] | 220 | Huge Pages |
| 221 | ~~~~~~~~~~~~ |
| 222 | |
| 223 | Huge Pages give a performance boost to applications that intensively deal |
| 224 | with memory allocation/deallocation by decreasing memory fragmentation. |
| 225 | |
| 226 | .. code-block:: yaml |
| 227 | |
| 228 | linux: |
| 229 | system: |
| 230 | kernel: |
| 231 | hugepages: |
| 232 | small: |
| 233 | size: 2M |
| 234 | count: 107520 |
| 235 | mount_point: /mnt/hugepages_2MB |
| 236 | mount: false/true # default false |
| 237 | large: |
| 238 | default: true # default automatically mounted |
| 239 | size: 1G |
| 240 | count: 210 |
| 241 | mount_point: /mnt/hugepages_1GB |
| 242 | |
| 243 | Note: not recommended to use both pagesizes in concurrently. |
Jiri Broulik | f8f55a2 | 2017-01-26 14:36:46 +0100 | [diff] [blame] | 244 | |
| 245 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 246 | Repositories |
| 247 | ~~~~~~~~~~~~ |
| 248 | |
| 249 | RedHat based Linux with additional OpenStack repo |
| 250 | |
| 251 | .. code-block:: yaml |
| 252 | |
| 253 | linux: |
| 254 | system: |
| 255 | ... |
| 256 | repo: |
| 257 | rdo-icehouse: |
| 258 | enabled: true |
| 259 | source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/' |
| 260 | pgpcheck: 0 |
| 261 | |
| 262 | Ensure system repository to use czech Debian mirror (``default: true``) |
| 263 | Also pin it's packages with priority 900. |
| 264 | |
| 265 | .. code-block:: yaml |
| 266 | |
| 267 | linux: |
| 268 | system: |
| 269 | repo: |
| 270 | debian: |
| 271 | default: true |
| 272 | source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free" |
| 273 | # Import signing key from URL if needed |
| 274 | key_url: "http://dummy.com/public.gpg" |
| 275 | pin: |
| 276 | - pin: 'origin "ftp.cz.debian.org"' |
| 277 | priority: 900 |
| 278 | package: '*' |
| 279 | |
Jakub Pavlik | 7885938 | 2016-01-21 11:26:39 +0100 | [diff] [blame] | 280 | rc.local example |
| 281 | |
| 282 | .. code-block:: yaml |
| 283 | |
| 284 | linux: |
| 285 | system: |
| 286 | rc: |
| 287 | local: | |
| 288 | #!/bin/sh -e |
| 289 | # |
| 290 | # rc.local |
| 291 | # |
| 292 | # This script is executed at the end of each multiuser runlevel. |
| 293 | # Make sure that the script will "exit 0" on success or any other |
| 294 | # value on error. |
| 295 | # |
| 296 | # In order to enable or disable this script just change the execution |
| 297 | # bits. |
| 298 | # |
| 299 | # By default this script does nothing. |
| 300 | exit 0 |
| 301 | |
Filip Pytloun | 1f40dac | 2016-01-22 15:52:57 +0100 | [diff] [blame] | 302 | Prompt |
| 303 | ~~~~~~ |
| 304 | |
| 305 | Setting prompt is implemented by creating ``/etc/profile.d/prompt.sh``. Every |
| 306 | user can have different prompt. |
| 307 | |
| 308 | .. code-block:: yaml |
| 309 | |
| 310 | linux: |
| 311 | system: |
| 312 | prompt: |
| 313 | 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\\] |
| 314 | default: \\n\\D{%y/%m/%d %H:%M:%S} $(hostname -f)\\n[\\u@\\h:\\w] |
| 315 | |
| 316 | On Debian systems to set prompt system-wide it's necessary to remove setting |
| 317 | PS1 in ``/etc/bash.bashrc`` and ``~/.bashrc`` (which comes from |
| 318 | ``/etc/skel/.bashrc``). This formula will do this automatically, but will not |
Filip Pytloun | d9b68da | 2016-01-22 15:58:41 +0100 | [diff] [blame] | 319 | touch existing user's ``~/.bashrc`` files except root. |
Jakub Pavlik | 7885938 | 2016-01-21 11:26:39 +0100 | [diff] [blame] | 320 | |
Filip Pytloun | eef11c1 | 2016-03-25 11:00:23 +0100 | [diff] [blame] | 321 | Bash |
| 322 | ~~~~ |
| 323 | |
| 324 | Fix bash configuration to preserve history across sessions (like ZSH does by |
| 325 | default). |
| 326 | |
| 327 | .. code-block:: yaml |
| 328 | |
| 329 | linux: |
| 330 | system: |
| 331 | bash: |
| 332 | preserve_history: true |
| 333 | |
Filip Pytloun | e874dfb | 2016-01-22 16:57:34 +0100 | [diff] [blame] | 334 | Message of the day |
| 335 | ~~~~~~~~~~~~~~~~~~ |
| 336 | |
| 337 | ``pam_motd`` from package ``update-motd`` is used for dynamic messages of the |
| 338 | day. Setting custom motd will cleanup existing ones. |
| 339 | |
| 340 | .. code-block:: yaml |
| 341 | |
| 342 | linux: |
| 343 | system: |
| 344 | motd: |
| 345 | - release: | |
| 346 | #!/bin/sh |
| 347 | [ -r /etc/lsb-release ] && . /etc/lsb-release |
| 348 | |
| 349 | if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then |
| 350 | # Fall back to using the very slow lsb_release utility |
| 351 | DISTRIB_DESCRIPTION=$(lsb_release -s -d) |
| 352 | fi |
| 353 | |
| 354 | printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)" |
| 355 | - warning: | |
| 356 | #!/bin/sh |
| 357 | printf "This is [company name] network.\n" |
| 358 | printf "Unauthorized access strictly prohibited.\n" |
| 359 | |
Filip Pytloun | 2f70b49 | 2016-02-19 15:55:25 +0100 | [diff] [blame] | 360 | RHEL / CentOS |
Filip Pytloun | 8296bb9 | 2016-02-19 18:42:09 +0100 | [diff] [blame] | 361 | ^^^^^^^^^^^^^ |
Filip Pytloun | 2f70b49 | 2016-02-19 15:55:25 +0100 | [diff] [blame] | 362 | |
| 363 | Unfortunately ``update-motd`` is currently not available for RHEL so there's |
| 364 | no native support for dynamic motd. |
| 365 | You can still set static one, only pillar structure differs: |
| 366 | |
| 367 | .. code-block:: yaml |
| 368 | |
| 369 | linux: |
| 370 | system: |
| 371 | motd: | |
| 372 | This is [company name] network. |
| 373 | Unauthorized access strictly prohibited. |
| 374 | |
Filip Pytloun | 8296bb9 | 2016-02-19 18:42:09 +0100 | [diff] [blame] | 375 | Haveged |
| 376 | ~~~~~~~ |
| 377 | |
| 378 | If you are running headless server and are low on entropy, it may be a good |
| 379 | idea to setup Haveged. |
| 380 | |
| 381 | .. code-block:: yaml |
| 382 | |
| 383 | linux: |
| 384 | system: |
| 385 | haveged: |
| 386 | enabled: true |
| 387 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 388 | Linux network |
| 389 | ------------- |
| 390 | |
| 391 | Linux with network manager |
| 392 | |
| 393 | .. code-block:: yaml |
| 394 | |
| 395 | linux: |
| 396 | network: |
| 397 | enabled: true |
| 398 | network_manager: true |
| 399 | |
| 400 | Linux with default static network interfaces, default gateway interface and DNS servers |
| 401 | |
| 402 | .. code-block:: yaml |
| 403 | |
| 404 | linux: |
| 405 | network: |
| 406 | enabled: true |
| 407 | interface: |
| 408 | eth0: |
| 409 | enabled: true |
| 410 | type: eth |
| 411 | address: 192.168.0.102 |
| 412 | netmask: 255.255.255.0 |
| 413 | gateway: 192.168.0.1 |
| 414 | name_servers: |
| 415 | - 8.8.8.8 |
| 416 | - 8.8.4.4 |
| 417 | mtu: 1500 |
| 418 | |
jan kaufman | 6d30adf | 2016-01-18 17:30:12 +0100 | [diff] [blame] | 419 | Linux with bonded interfaces and disabled NetworkManager |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 420 | |
| 421 | .. code-block:: yaml |
| 422 | |
| 423 | linux: |
| 424 | network: |
| 425 | enabled: true |
| 426 | interface: |
| 427 | eth0: |
| 428 | type: eth |
| 429 | ... |
| 430 | eth1: |
| 431 | type: eth |
| 432 | ... |
| 433 | bond0: |
| 434 | enabled: true |
| 435 | type: bond |
| 436 | address: 192.168.0.102 |
| 437 | netmask: 255.255.255.0 |
| 438 | mtu: 1500 |
| 439 | use_in: |
| 440 | - interface: ${linux:interface:eth0} |
| 441 | - interface: ${linux:interface:eth0} |
jan kaufman | 6d30adf | 2016-01-18 17:30:12 +0100 | [diff] [blame] | 442 | network_manager: |
| 443 | disable: true |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 444 | |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 445 | Linux with vlan interface_params |
| 446 | |
| 447 | .. code-block:: yaml |
| 448 | |
| 449 | linux: |
| 450 | network: |
| 451 | enabled: true |
| 452 | interface: |
| 453 | vlan69: |
| 454 | type: vlan |
jan kaufman | c0bd76f | 2015-12-15 16:45:44 +0100 | [diff] [blame] | 455 | use_interfaces: |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 456 | - interface: ${linux:interface:bond0} |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 457 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 458 | Linux with wireless interface parameters |
| 459 | |
| 460 | .. code-block:: yaml |
| 461 | |
| 462 | linux: |
| 463 | network: |
| 464 | enabled: true |
| 465 | gateway: 10.0.0.1 |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 466 | default_interface: eth0 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 467 | interface: |
| 468 | wlan0: |
| 469 | type: eth |
| 470 | wireless: |
| 471 | essid: example |
| 472 | key: example_key |
| 473 | security: wpa |
| 474 | priority: 1 |
| 475 | |
| 476 | Linux networks with routes defined |
| 477 | |
| 478 | .. code-block:: yaml |
| 479 | |
| 480 | linux: |
| 481 | network: |
| 482 | enabled: true |
| 483 | gateway: 10.0.0.1 |
Jan Kaufman | 6a1ad71 | 2015-12-11 14:44:19 +0100 | [diff] [blame] | 484 | default_interface: eth0 |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 485 | interface: |
| 486 | eth0: |
| 487 | type: eth |
| 488 | route: |
| 489 | default: |
| 490 | address: 192.168.0.123 |
| 491 | netmask: 255.255.255.0 |
| 492 | gateway: 192.168.0.1 |
| 493 | |
| 494 | Native Linux Bridges |
| 495 | |
| 496 | .. code-block:: yaml |
| 497 | |
| 498 | linux: |
| 499 | network: |
| 500 | interface: |
| 501 | eth1: |
| 502 | enabled: true |
| 503 | type: eth |
| 504 | proto: manual |
| 505 | up_cmds: |
| 506 | - ip address add 0/0 dev $IFACE |
| 507 | - ip link set $IFACE up |
| 508 | down_cmds: |
| 509 | - ip link set $IFACE down |
| 510 | br-ex: |
| 511 | enabled: true |
| 512 | type: bridge |
| 513 | address: ${linux:network:host:public_local:address} |
| 514 | netmask: 255.255.255.0 |
| 515 | use_interfaces: |
| 516 | - eth1 |
| 517 | |
| 518 | OpenVswitch Bridges |
| 519 | |
| 520 | .. code-block:: yaml |
| 521 | |
| 522 | linux: |
| 523 | network: |
| 524 | bridge: openvswitch |
| 525 | interface: |
| 526 | eth1: |
| 527 | enabled: true |
| 528 | type: eth |
| 529 | proto: manual |
| 530 | up_cmds: |
| 531 | - ip address add 0/0 dev $IFACE |
| 532 | - ip link set $IFACE up |
| 533 | down_cmds: |
| 534 | - ip link set $IFACE down |
| 535 | br-ex: |
| 536 | enabled: true |
| 537 | type: bridge |
| 538 | address: ${linux:network:host:public_local:address} |
| 539 | netmask: 255.255.255.0 |
| 540 | use_interfaces: |
| 541 | - eth1 |
| 542 | |
| 543 | Linux with proxy |
| 544 | |
| 545 | .. code-block:: yaml |
| 546 | |
| 547 | linux: |
| 548 | network: |
| 549 | ... |
| 550 | proxy: |
| 551 | host: proxy.domain.com |
| 552 | port: 3128 |
| 553 | |
| 554 | Linux with hosts |
| 555 | |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 556 | Parameter purge_hosts will enforce whole /etc/hosts file, removing entries |
| 557 | that are not defined in model except defaults for both IPv4 and IPv6 localhost |
| 558 | and hostname + fqdn. |
| 559 | It's good to use this option if you want to ensure /etc/hosts is always in a |
| 560 | clean state however it's not enabled by default for safety. |
| 561 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 562 | .. code-block:: yaml |
| 563 | |
| 564 | linux: |
| 565 | network: |
| 566 | ... |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 567 | purge_hosts: true |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 568 | host: |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 569 | # No need to define this one if purge_hosts is true |
| 570 | hostname: |
| 571 | address: 127.0.1.1 |
| 572 | names: |
| 573 | - ${linux:network:fqdn} |
| 574 | - ${linux:network:hostname} |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 575 | node1: |
| 576 | address: 192.168.10.200 |
| 577 | names: |
| 578 | - node2.domain.com |
| 579 | - service2.domain.com |
| 580 | node2: |
| 581 | address: 192.168.10.201 |
| 582 | names: |
| 583 | - node2.domain.com |
| 584 | - service2.domain.com |
| 585 | |
Filip Pytloun | 86506fe | 2017-01-26 14:36:16 +0100 | [diff] [blame] | 586 | |
Filip Pytloun | de9bea5 | 2016-01-11 15:39:10 +0100 | [diff] [blame] | 587 | Setup resolv.conf, nameservers, domain and search domains |
| 588 | |
| 589 | .. code-block:: yaml |
| 590 | |
| 591 | linux: |
| 592 | network: |
| 593 | resolv: |
| 594 | dns: |
| 595 | - 8.8.4.4 |
| 596 | - 8.8.8.8 |
| 597 | domain: my.example.com |
| 598 | search: |
| 599 | - my.example.com |
| 600 | - example.com |
Marek Celoud | f6cd192 | 2016-12-05 13:39:49 +0100 | [diff] [blame] | 601 | options: |
| 602 | - ndots:5 |
| 603 | - timeout:2 |
| 604 | - attempts:2 |
Filip Pytloun | de9bea5 | 2016-01-11 15:39:10 +0100 | [diff] [blame] | 605 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 606 | Linux storage pillars |
| 607 | --------------------- |
| 608 | |
| 609 | Linux with mounted Samba |
| 610 | |
| 611 | .. code-block:: yaml |
| 612 | |
| 613 | linux: |
| 614 | storage: |
| 615 | enabled: true |
| 616 | mount: |
| 617 | samba1: |
Simon Pasquier | 376262a | 2016-11-16 15:21:51 +0100 | [diff] [blame] | 618 | - enabled: true |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 619 | - path: /media/myuser/public/ |
| 620 | - device: //192.168.0.1/storage |
| 621 | - file_system: cifs |
| 622 | - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm |
| 623 | |
| 624 | Linux with file swap |
| 625 | |
| 626 | .. code-block:: yaml |
| 627 | |
| 628 | linux: |
| 629 | storage: |
| 630 | enabled: true |
| 631 | swap: |
| 632 | file: |
| 633 | enabled: true |
| 634 | engine: file |
| 635 | device: /swapfile |
| 636 | size: 1024 |
| 637 | |
Lachlan Evenson | 3067651 | 2016-01-22 15:43:28 -0800 | [diff] [blame] | 638 | Linux with partition swap |
| 639 | |
| 640 | .. code-block:: yaml |
| 641 | |
| 642 | linux: |
| 643 | storage: |
| 644 | enabled: true |
| 645 | swap: |
| 646 | partition: |
| 647 | enabled: true |
| 648 | engine: partition |
| 649 | device: /dev/vg0/swap |
| 650 | |
Filip Pytloun | c8a001a | 2015-12-15 14:09:19 +0100 | [diff] [blame] | 651 | LVM group `vg1` with one device and `data` volume mounted into `/mnt/data` |
| 652 | |
| 653 | .. code-block:: yaml |
| 654 | |
| 655 | parameters: |
| 656 | linux: |
| 657 | storage: |
| 658 | mount: |
| 659 | data: |
Simon Pasquier | 376262a | 2016-11-16 15:21:51 +0100 | [diff] [blame] | 660 | enabled: true |
Filip Pytloun | c8a001a | 2015-12-15 14:09:19 +0100 | [diff] [blame] | 661 | device: /dev/vg1/data |
| 662 | file_system: ext4 |
| 663 | path: /mnt/data |
| 664 | lvm: |
| 665 | vg1: |
| 666 | enabled: true |
| 667 | devices: |
| 668 | - /dev/sdb |
| 669 | volume: |
| 670 | data: |
| 671 | size: 40G |
| 672 | mount: ${linux:storage:mount:data} |
| 673 | |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 674 | |
| 675 | Multipath with Fujitsu Eternus DXL |
| 676 | |
| 677 | .. code-block:: yaml |
| 678 | |
| 679 | parameters: |
| 680 | linux: |
| 681 | storage: |
| 682 | multipath: |
| 683 | enabled: true |
| 684 | blacklist_devices: |
| 685 | - /dev/sda |
| 686 | - /dev/sdb |
| 687 | backends: |
| 688 | - fujitsu_eternus_dxl |
| 689 | |
| 690 | Multipath with Hitachi VSP 1000 |
| 691 | |
| 692 | .. code-block:: yaml |
| 693 | |
| 694 | parameters: |
| 695 | linux: |
| 696 | storage: |
| 697 | multipath: |
| 698 | enabled: true |
| 699 | blacklist_devices: |
| 700 | - /dev/sda |
| 701 | - /dev/sdb |
| 702 | backends: |
| 703 | - hitachi_vsp1000 |
| 704 | |
| 705 | Multipath with IBM Storwize |
| 706 | |
| 707 | .. code-block:: yaml |
| 708 | |
| 709 | parameters: |
| 710 | linux: |
| 711 | storage: |
| 712 | multipath: |
| 713 | enabled: true |
| 714 | blacklist_devices: |
| 715 | - /dev/sda |
| 716 | - /dev/sdb |
| 717 | backends: |
| 718 | - ibm_storwize |
| 719 | |
| 720 | Multipath with multiple backends |
| 721 | |
| 722 | .. code-block:: yaml |
| 723 | |
| 724 | parameters: |
| 725 | linux: |
| 726 | storage: |
| 727 | multipath: |
| 728 | enabled: true |
| 729 | blacklist_devices: |
| 730 | - /dev/sda |
| 731 | - /dev/sdb |
| 732 | - /dev/sdc |
| 733 | - /dev/sdd |
| 734 | backends: |
| 735 | - ibm_storwize |
| 736 | - fujitsu_eternus_dxl |
| 737 | - hitachi_vsp1000 |
| 738 | |
| 739 | Disabled multipath (the default setup) |
| 740 | |
| 741 | .. code-block:: yaml |
| 742 | |
| 743 | parameters: |
| 744 | linux: |
| 745 | storage: |
| 746 | multipath: |
| 747 | enabled: false |
| 748 | |
Simon Pasquier | 375001e | 2017-01-26 13:22:33 +0100 | [diff] [blame] | 749 | Linux with local loopback device |
| 750 | |
| 751 | .. code-block:: yaml |
| 752 | |
| 753 | linux: |
| 754 | storage: |
| 755 | loopback: |
| 756 | disk1: |
| 757 | file: /srv/disk1 |
| 758 | size: 50G |
| 759 | |
Filip Pytloun | b2c8f85 | 2016-11-21 17:03:43 +0100 | [diff] [blame] | 760 | External config generation |
| 761 | -------------------------- |
| 762 | |
| 763 | You are able to use config support metadata between formulas and only generate |
| 764 | config files for external use, eg. docker, etc. |
| 765 | |
| 766 | .. code-block:: yaml |
| 767 | |
| 768 | parameters: |
| 769 | linux: |
| 770 | system: |
| 771 | config: |
| 772 | pillar: |
| 773 | jenkins: |
| 774 | master: |
| 775 | home: /srv/volumes/jenkins |
| 776 | approved_scripts: |
| 777 | - method java.net.URL openConnection |
| 778 | credentials: |
| 779 | - type: username_password |
| 780 | scope: global |
| 781 | id: test |
| 782 | desc: Testing credentials |
| 783 | username: test |
| 784 | password: test |
| 785 | |
Ales Komarek | a634f4b | 2016-10-02 13:11:04 +0200 | [diff] [blame] | 786 | |
Filip Pytloun | f5383a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 787 | Usage |
| 788 | ===== |
| 789 | |
| 790 | Set mtu of network interface eth0 to 1400 |
| 791 | |
| 792 | .. code-block:: bash |
| 793 | |
| 794 | ip link set dev eth0 mtu 1400 |
| 795 | |
| 796 | Read more |
| 797 | ========= |
| 798 | |
| 799 | * https://www.archlinux.org/ |
| 800 | * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu |
Filip Pytloun | 018f871 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 801 | |
| 802 | Documentation and Bugs |
| 803 | ====================== |
| 804 | |
| 805 | To learn how to install and update salt-formulas, consult the documentation |
| 806 | available online at: |
| 807 | |
| 808 | http://salt-formulas.readthedocs.io/ |
| 809 | |
| 810 | In the unfortunate event that bugs are discovered, they should be reported to |
| 811 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 812 | formula: |
| 813 | |
| 814 | https://github.com/salt-formulas/salt-formula-linux/issues |
| 815 | |
| 816 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 817 | use Launchpad salt-formulas project: |
| 818 | |
| 819 | https://launchpad.net/salt-formulas |
| 820 | |
| 821 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 822 | |
| 823 | https://launchpad.net/~salt-formulas-users |
| 824 | |
| 825 | Developers wishing to work on the salt-formulas projects should always base |
| 826 | their work on master branch and submit pull request against specific formula. |
| 827 | |
| 828 | https://github.com/salt-formulas/salt-formula-linux |
| 829 | |
| 830 | Any questions or feedback is always welcome so feel free to join our IRC |
| 831 | channel: |
| 832 | |
| 833 | #salt-formulas @ irc.freenode.net |