blob: bd9d7f2e12ffafacdddc69971de51283eddecd3b [file] [log] [blame]
Filip Pytlounf5383a42015-10-06 16:28:32 +02001
2=====
3Linux
4=====
5
6Linux Operating Systems.
7
8* Ubuntu
9* CentOS
10* RedHat
11* Fedora
12* Arch
13
14Sample pillars
15==============
16
17Linux system
18------------
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
34Linux 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
57Linux with package, latest version
58
59.. code-block:: yaml
60
61 linux:
62 system:
63 ...
64 package:
65 package-name:
66 version: latest
67
68Linux 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
81Linux 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
94Linux 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 Pytlound0a29e72015-11-30 15:23:34 +0100109Linux 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 Pytloun7fee0542015-10-15 11:19:24 +0200125Enable 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
134
135To disable set autologin to `false`.
136
Filip Pytlounf5383a42015-10-06 16:28:32 +0200137Repositories
138~~~~~~~~~~~~
139
140RedHat based Linux with additional OpenStack repo
141
142.. code-block:: yaml
143
144 linux:
145 system:
146 ...
147 repo:
148 rdo-icehouse:
149 enabled: true
150 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
151 pgpcheck: 0
152
153Ensure system repository to use czech Debian mirror (``default: true``)
154Also pin it's packages with priority 900.
155
156.. code-block:: yaml
157
158 linux:
159 system:
160 repo:
161 debian:
162 default: true
163 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
164 # Import signing key from URL if needed
165 key_url: "http://dummy.com/public.gpg"
166 pin:
167 - pin: 'origin "ftp.cz.debian.org"'
168 priority: 900
169 package: '*'
170
171Linux network
172-------------
173
174Linux with network manager
175
176.. code-block:: yaml
177
178 linux:
179 network:
180 enabled: true
181 network_manager: true
182
183Linux with default static network interfaces, default gateway interface and DNS servers
184
185.. code-block:: yaml
186
187 linux:
188 network:
189 enabled: true
190 interface:
191 eth0:
192 enabled: true
193 type: eth
194 address: 192.168.0.102
195 netmask: 255.255.255.0
196 gateway: 192.168.0.1
197 name_servers:
198 - 8.8.8.8
199 - 8.8.4.4
200 mtu: 1500
201
202Linux with bonded interfaces
203
204.. code-block:: yaml
205
206 linux:
207 network:
208 enabled: true
209 interface:
210 eth0:
211 type: eth
212 ...
213 eth1:
214 type: eth
215 ...
216 bond0:
217 enabled: true
218 type: bond
219 address: 192.168.0.102
220 netmask: 255.255.255.0
221 mtu: 1500
222 use_in:
223 - interface: ${linux:interface:eth0}
224 - interface: ${linux:interface:eth0}
225
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100226Linux with vlan interface_params
227
228.. code-block:: yaml
229
230 linux:
231 network:
232 enabled: true
233 interface:
234 vlan69:
235 type: vlan
jan kaufmanc0bd76f2015-12-15 16:45:44 +0100236 use_interfaces:
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100237 - interface: ${linux:interface:bond0}
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100238
Filip Pytlounf5383a42015-10-06 16:28:32 +0200239Linux with wireless interface parameters
240
241.. code-block:: yaml
242
243 linux:
244 network:
245 enabled: true
246 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100247 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200248 interface:
249 wlan0:
250 type: eth
251 wireless:
252 essid: example
253 key: example_key
254 security: wpa
255 priority: 1
256
257Linux networks with routes defined
258
259.. code-block:: yaml
260
261 linux:
262 network:
263 enabled: true
264 gateway: 10.0.0.1
Jan Kaufman6a1ad712015-12-11 14:44:19 +0100265 default_interface: eth0
Filip Pytlounf5383a42015-10-06 16:28:32 +0200266 interface:
267 eth0:
268 type: eth
269 route:
270 default:
271 address: 192.168.0.123
272 netmask: 255.255.255.0
273 gateway: 192.168.0.1
274
275Native Linux Bridges
276
277.. code-block:: yaml
278
279 linux:
280 network:
281 interface:
282 eth1:
283 enabled: true
284 type: eth
285 proto: manual
286 up_cmds:
287 - ip address add 0/0 dev $IFACE
288 - ip link set $IFACE up
289 down_cmds:
290 - ip link set $IFACE down
291 br-ex:
292 enabled: true
293 type: bridge
294 address: ${linux:network:host:public_local:address}
295 netmask: 255.255.255.0
296 use_interfaces:
297 - eth1
298
299OpenVswitch Bridges
300
301.. code-block:: yaml
302
303 linux:
304 network:
305 bridge: openvswitch
306 interface:
307 eth1:
308 enabled: true
309 type: eth
310 proto: manual
311 up_cmds:
312 - ip address add 0/0 dev $IFACE
313 - ip link set $IFACE up
314 down_cmds:
315 - ip link set $IFACE down
316 br-ex:
317 enabled: true
318 type: bridge
319 address: ${linux:network:host:public_local:address}
320 netmask: 255.255.255.0
321 use_interfaces:
322 - eth1
323
324Linux with proxy
325
326.. code-block:: yaml
327
328 linux:
329 network:
330 ...
331 proxy:
332 host: proxy.domain.com
333 port: 3128
334
335Linux with hosts
336
337.. code-block:: yaml
338
339 linux:
340 network:
341 ...
342 host:
343 node1:
344 address: 192.168.10.200
345 names:
346 - node2.domain.com
347 - service2.domain.com
348 node2:
349 address: 192.168.10.201
350 names:
351 - node2.domain.com
352 - service2.domain.com
353
354Linux storage pillars
355---------------------
356
357Linux with mounted Samba
358
359.. code-block:: yaml
360
361 linux:
362 storage:
363 enabled: true
364 mount:
365 samba1:
366 - path: /media/myuser/public/
367 - device: //192.168.0.1/storage
368 - file_system: cifs
369 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
370
371Linux with file swap
372
373.. code-block:: yaml
374
375 linux:
376 storage:
377 enabled: true
378 swap:
379 file:
380 enabled: true
381 engine: file
382 device: /swapfile
383 size: 1024
384
Filip Pytlounc8a001a2015-12-15 14:09:19 +0100385LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
386
387.. code-block:: yaml
388
389 parameters:
390 linux:
391 storage:
392 mount:
393 data:
394 device: /dev/vg1/data
395 file_system: ext4
396 path: /mnt/data
397 lvm:
398 vg1:
399 enabled: true
400 devices:
401 - /dev/sdb
402 volume:
403 data:
404 size: 40G
405 mount: ${linux:storage:mount:data}
406
Filip Pytlounf5383a42015-10-06 16:28:32 +0200407Usage
408=====
409
410Set mtu of network interface eth0 to 1400
411
412.. code-block:: bash
413
414 ip link set dev eth0 mtu 1400
415
416Read more
417=========
418
419* https://www.archlinux.org/
420* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu