blob: c3e2e324d25510891d2af3d0cd3d6702105367eb [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
226Linux with wireless interface parameters
227
228.. code-block:: yaml
229
230 linux:
231 network:
232 enabled: true
233 gateway: 10.0.0.1
234 default_interface: eth0
235 interface:
236 wlan0:
237 type: eth
238 wireless:
239 essid: example
240 key: example_key
241 security: wpa
242 priority: 1
243
244Linux networks with routes defined
245
246.. code-block:: yaml
247
248 linux:
249 network:
250 enabled: true
251 gateway: 10.0.0.1
252 default_interface: eth0
253 interface:
254 eth0:
255 type: eth
256 route:
257 default:
258 address: 192.168.0.123
259 netmask: 255.255.255.0
260 gateway: 192.168.0.1
261
262Native Linux Bridges
263
264.. code-block:: yaml
265
266 linux:
267 network:
268 interface:
269 eth1:
270 enabled: true
271 type: eth
272 proto: manual
273 up_cmds:
274 - ip address add 0/0 dev $IFACE
275 - ip link set $IFACE up
276 down_cmds:
277 - ip link set $IFACE down
278 br-ex:
279 enabled: true
280 type: bridge
281 address: ${linux:network:host:public_local:address}
282 netmask: 255.255.255.0
283 use_interfaces:
284 - eth1
285
286OpenVswitch Bridges
287
288.. code-block:: yaml
289
290 linux:
291 network:
292 bridge: openvswitch
293 interface:
294 eth1:
295 enabled: true
296 type: eth
297 proto: manual
298 up_cmds:
299 - ip address add 0/0 dev $IFACE
300 - ip link set $IFACE up
301 down_cmds:
302 - ip link set $IFACE down
303 br-ex:
304 enabled: true
305 type: bridge
306 address: ${linux:network:host:public_local:address}
307 netmask: 255.255.255.0
308 use_interfaces:
309 - eth1
310
311Linux with proxy
312
313.. code-block:: yaml
314
315 linux:
316 network:
317 ...
318 proxy:
319 host: proxy.domain.com
320 port: 3128
321
322Linux with hosts
323
324.. code-block:: yaml
325
326 linux:
327 network:
328 ...
329 host:
330 node1:
331 address: 192.168.10.200
332 names:
333 - node2.domain.com
334 - service2.domain.com
335 node2:
336 address: 192.168.10.201
337 names:
338 - node2.domain.com
339 - service2.domain.com
340
341Linux storage pillars
342---------------------
343
344Linux with mounted Samba
345
346.. code-block:: yaml
347
348 linux:
349 storage:
350 enabled: true
351 mount:
352 samba1:
353 - path: /media/myuser/public/
354 - device: //192.168.0.1/storage
355 - file_system: cifs
356 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
357
358Linux with file swap
359
360.. code-block:: yaml
361
362 linux:
363 storage:
364 enabled: true
365 swap:
366 file:
367 enabled: true
368 engine: file
369 device: /swapfile
370 size: 1024
371
Filip Pytlounc8a001a2015-12-15 14:09:19 +0100372LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
373
374.. code-block:: yaml
375
376 parameters:
377 linux:
378 storage:
379 mount:
380 data:
381 device: /dev/vg1/data
382 file_system: ext4
383 path: /mnt/data
384 lvm:
385 vg1:
386 enabled: true
387 devices:
388 - /dev/sdb
389 volume:
390 data:
391 size: 40G
392 mount: ${linux:storage:mount:data}
393
Filip Pytlounf5383a42015-10-06 16:28:32 +0200394Usage
395=====
396
397Set mtu of network interface eth0 to 1400
398
399.. code-block:: bash
400
401 ip link set dev eth0 mtu 1400
402
403Read more
404=========
405
406* https://www.archlinux.org/
407* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu