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