blob: d7454eeccee3db630dfa4b99d588d7fa94a43e3f [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 Pytloun7fee0542015-10-15 11:19:24 +0200109Enable autologin on tty1 (may work only for Ubuntu 14.04):
110
111.. code-block:: yaml
112
113 linux:
114 system:
115 console:
116 tty1:
117 autologin: root
118
119To disable set autologin to `false`.
120
Filip Pytlounf5383a42015-10-06 16:28:32 +0200121Repositories
122~~~~~~~~~~~~
123
124RedHat based Linux with additional OpenStack repo
125
126.. code-block:: yaml
127
128 linux:
129 system:
130 ...
131 repo:
132 rdo-icehouse:
133 enabled: true
134 source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
135 pgpcheck: 0
136
137Ensure system repository to use czech Debian mirror (``default: true``)
138Also pin it's packages with priority 900.
139
140.. code-block:: yaml
141
142 linux:
143 system:
144 repo:
145 debian:
146 default: true
147 source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
148 # Import signing key from URL if needed
149 key_url: "http://dummy.com/public.gpg"
150 pin:
151 - pin: 'origin "ftp.cz.debian.org"'
152 priority: 900
153 package: '*'
154
155Linux network
156-------------
157
158Linux with network manager
159
160.. code-block:: yaml
161
162 linux:
163 network:
164 enabled: true
165 network_manager: true
166
167Linux with default static network interfaces, default gateway interface and DNS servers
168
169.. code-block:: yaml
170
171 linux:
172 network:
173 enabled: true
174 interface:
175 eth0:
176 enabled: true
177 type: eth
178 address: 192.168.0.102
179 netmask: 255.255.255.0
180 gateway: 192.168.0.1
181 name_servers:
182 - 8.8.8.8
183 - 8.8.4.4
184 mtu: 1500
185
186Linux with bonded interfaces
187
188.. code-block:: yaml
189
190 linux:
191 network:
192 enabled: true
193 interface:
194 eth0:
195 type: eth
196 ...
197 eth1:
198 type: eth
199 ...
200 bond0:
201 enabled: true
202 type: bond
203 address: 192.168.0.102
204 netmask: 255.255.255.0
205 mtu: 1500
206 use_in:
207 - interface: ${linux:interface:eth0}
208 - interface: ${linux:interface:eth0}
209
210Linux with wireless interface parameters
211
212.. code-block:: yaml
213
214 linux:
215 network:
216 enabled: true
217 gateway: 10.0.0.1
218 default_interface: eth0
219 interface:
220 wlan0:
221 type: eth
222 wireless:
223 essid: example
224 key: example_key
225 security: wpa
226 priority: 1
227
228Linux networks with routes defined
229
230.. code-block:: yaml
231
232 linux:
233 network:
234 enabled: true
235 gateway: 10.0.0.1
236 default_interface: eth0
237 interface:
238 eth0:
239 type: eth
240 route:
241 default:
242 address: 192.168.0.123
243 netmask: 255.255.255.0
244 gateway: 192.168.0.1
245
246Native Linux Bridges
247
248.. code-block:: yaml
249
250 linux:
251 network:
252 interface:
253 eth1:
254 enabled: true
255 type: eth
256 proto: manual
257 up_cmds:
258 - ip address add 0/0 dev $IFACE
259 - ip link set $IFACE up
260 down_cmds:
261 - ip link set $IFACE down
262 br-ex:
263 enabled: true
264 type: bridge
265 address: ${linux:network:host:public_local:address}
266 netmask: 255.255.255.0
267 use_interfaces:
268 - eth1
269
270OpenVswitch Bridges
271
272.. code-block:: yaml
273
274 linux:
275 network:
276 bridge: openvswitch
277 interface:
278 eth1:
279 enabled: true
280 type: eth
281 proto: manual
282 up_cmds:
283 - ip address add 0/0 dev $IFACE
284 - ip link set $IFACE up
285 down_cmds:
286 - ip link set $IFACE down
287 br-ex:
288 enabled: true
289 type: bridge
290 address: ${linux:network:host:public_local:address}
291 netmask: 255.255.255.0
292 use_interfaces:
293 - eth1
294
295Linux with proxy
296
297.. code-block:: yaml
298
299 linux:
300 network:
301 ...
302 proxy:
303 host: proxy.domain.com
304 port: 3128
305
306Linux with hosts
307
308.. code-block:: yaml
309
310 linux:
311 network:
312 ...
313 host:
314 node1:
315 address: 192.168.10.200
316 names:
317 - node2.domain.com
318 - service2.domain.com
319 node2:
320 address: 192.168.10.201
321 names:
322 - node2.domain.com
323 - service2.domain.com
324
325Linux storage pillars
326---------------------
327
328Linux with mounted Samba
329
330.. code-block:: yaml
331
332 linux:
333 storage:
334 enabled: true
335 mount:
336 samba1:
337 - path: /media/myuser/public/
338 - device: //192.168.0.1/storage
339 - file_system: cifs
340 - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
341
342Linux with file swap
343
344.. code-block:: yaml
345
346 linux:
347 storage:
348 enabled: true
349 swap:
350 file:
351 enabled: true
352 engine: file
353 device: /swapfile
354 size: 1024
355
356Usage
357=====
358
359Set mtu of network interface eth0 to 1400
360
361.. code-block:: bash
362
363 ip link set dev eth0 mtu 1400
364
365Read more
366=========
367
368* https://www.archlinux.org/
369* http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu