Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.rst 9.5KB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. =====
  2. Linux
  3. =====
  4. Linux Operating Systems.
  5. * Ubuntu
  6. * CentOS
  7. * RedHat
  8. * Fedora
  9. * Arch
  10. Sample pillars
  11. ==============
  12. Linux system
  13. ------------
  14. Basic Linux box
  15. .. code-block:: yaml
  16. linux:
  17. system:
  18. enabled: true
  19. name: 'node1'
  20. domain: 'domain.com'
  21. cluster: 'system'
  22. environment: prod
  23. timezone: 'Europe/Prague'
  24. utc: true
  25. Linux with system users, sowe with password set
  26. .. code-block:: yaml
  27. linux:
  28. system:
  29. ...
  30. user:
  31. jdoe:
  32. name: 'jdoe'
  33. enabled: true
  34. sudo: true
  35. shell: /bin/bash
  36. full_name: 'Jonh Doe'
  37. home: '/home/jdoe'
  38. email: 'jonh@doe.com'
  39. jsmith:
  40. name: 'jsmith'
  41. enabled: true
  42. full_name: 'Password'
  43. home: '/home/jsmith'
  44. password: userpassword
  45. Linux with package, latest version
  46. .. code-block:: yaml
  47. linux:
  48. system:
  49. ...
  50. package:
  51. package-name:
  52. version: latest
  53. Linux with package from certail repo, version with no upgrades
  54. .. code-block:: yaml
  55. linux:
  56. system:
  57. ...
  58. package:
  59. package-name:
  60. version: 2132.323
  61. repo: 'custom-repo'
  62. hold: true
  63. Linux with package from certail repo, version with no GPG verification
  64. .. code-block:: yaml
  65. linux:
  66. system:
  67. ...
  68. package:
  69. package-name:
  70. version: 2132.323
  71. repo: 'custom-repo'
  72. verify: false
  73. Linux with cron jobs
  74. .. code-block:: yaml
  75. linux:
  76. system:
  77. ...
  78. job:
  79. cmd1:
  80. command: '/cmd/to/run'
  81. enabled: true
  82. user: 'root'
  83. hour: 2
  84. minute: 0
  85. Linux security limits (limit sensu user memory usage to max 1GB):
  86. .. code-block:: yaml
  87. linux:
  88. system:
  89. ...
  90. limit:
  91. sensu:
  92. enabled: true
  93. domain: sensu
  94. limits:
  95. - type: hard
  96. item: as
  97. value: 1000000
  98. Enable autologin on tty1 (may work only for Ubuntu 14.04):
  99. .. code-block:: yaml
  100. linux:
  101. system:
  102. console:
  103. tty1:
  104. autologin: root
  105. To disable set autologin to `false`.
  106. Kernel
  107. ~~~~~~
  108. Install always up to date LTS kernel and headers from Ubuntu trusty:
  109. .. code-block:: yaml
  110. linux:
  111. system:
  112. kernel:
  113. type: generic
  114. lts: trusty
  115. headers: true
  116. Install specific kernel version and ensure all other kernel packages are
  117. not present. Also install extra modules and headers for this kernel:
  118. .. code-block:: yaml
  119. linux:
  120. system:
  121. kernel:
  122. type: generic
  123. extra: true
  124. headers: true
  125. version: 4.2.0-22
  126. Repositories
  127. ~~~~~~~~~~~~
  128. RedHat based Linux with additional OpenStack repo
  129. .. code-block:: yaml
  130. linux:
  131. system:
  132. ...
  133. repo:
  134. rdo-icehouse:
  135. enabled: true
  136. source: 'http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/'
  137. pgpcheck: 0
  138. Ensure system repository to use czech Debian mirror (``default: true``)
  139. Also pin it's packages with priority 900.
  140. .. code-block:: yaml
  141. linux:
  142. system:
  143. repo:
  144. debian:
  145. default: true
  146. source: "deb http://ftp.cz.debian.org/debian/ jessie main contrib non-free"
  147. # Import signing key from URL if needed
  148. key_url: "http://dummy.com/public.gpg"
  149. pin:
  150. - pin: 'origin "ftp.cz.debian.org"'
  151. priority: 900
  152. package: '*'
  153. rc.local example
  154. .. code-block:: yaml
  155. linux:
  156. system:
  157. rc:
  158. local: |
  159. #!/bin/sh -e
  160. #
  161. # rc.local
  162. #
  163. # This script is executed at the end of each multiuser runlevel.
  164. # Make sure that the script will "exit 0" on success or any other
  165. # value on error.
  166. #
  167. # In order to enable or disable this script just change the execution
  168. # bits.
  169. #
  170. # By default this script does nothing.
  171. exit 0
  172. Linux network
  173. -------------
  174. Linux with network manager
  175. .. code-block:: yaml
  176. linux:
  177. network:
  178. enabled: true
  179. network_manager: true
  180. Linux with default static network interfaces, default gateway interface and DNS servers
  181. .. code-block:: yaml
  182. linux:
  183. network:
  184. enabled: true
  185. interface:
  186. eth0:
  187. enabled: true
  188. type: eth
  189. address: 192.168.0.102
  190. netmask: 255.255.255.0
  191. gateway: 192.168.0.1
  192. name_servers:
  193. - 8.8.8.8
  194. - 8.8.4.4
  195. mtu: 1500
  196. Linux with bonded interfaces and disabled NetworkManager
  197. .. code-block:: yaml
  198. linux:
  199. network:
  200. enabled: true
  201. interface:
  202. eth0:
  203. type: eth
  204. ...
  205. eth1:
  206. type: eth
  207. ...
  208. bond0:
  209. enabled: true
  210. type: bond
  211. address: 192.168.0.102
  212. netmask: 255.255.255.0
  213. mtu: 1500
  214. use_in:
  215. - interface: ${linux:interface:eth0}
  216. - interface: ${linux:interface:eth0}
  217. network_manager:
  218. disable: true
  219. Linux with vlan interface_params
  220. .. code-block:: yaml
  221. linux:
  222. network:
  223. enabled: true
  224. interface:
  225. vlan69:
  226. type: vlan
  227. use_interfaces:
  228. - interface: ${linux:interface:bond0}
  229. Linux with wireless interface parameters
  230. .. code-block:: yaml
  231. linux:
  232. network:
  233. enabled: true
  234. gateway: 10.0.0.1
  235. default_interface: eth0
  236. interface:
  237. wlan0:
  238. type: eth
  239. wireless:
  240. essid: example
  241. key: example_key
  242. security: wpa
  243. priority: 1
  244. Linux networks with routes defined
  245. .. code-block:: yaml
  246. linux:
  247. network:
  248. enabled: true
  249. gateway: 10.0.0.1
  250. default_interface: eth0
  251. interface:
  252. eth0:
  253. type: eth
  254. route:
  255. default:
  256. address: 192.168.0.123
  257. netmask: 255.255.255.0
  258. gateway: 192.168.0.1
  259. Native Linux Bridges
  260. .. code-block:: yaml
  261. linux:
  262. network:
  263. interface:
  264. eth1:
  265. enabled: true
  266. type: eth
  267. proto: manual
  268. up_cmds:
  269. - ip address add 0/0 dev $IFACE
  270. - ip link set $IFACE up
  271. down_cmds:
  272. - ip link set $IFACE down
  273. br-ex:
  274. enabled: true
  275. type: bridge
  276. address: ${linux:network:host:public_local:address}
  277. netmask: 255.255.255.0
  278. use_interfaces:
  279. - eth1
  280. OpenVswitch Bridges
  281. .. code-block:: yaml
  282. linux:
  283. network:
  284. bridge: openvswitch
  285. interface:
  286. eth1:
  287. enabled: true
  288. type: eth
  289. proto: manual
  290. up_cmds:
  291. - ip address add 0/0 dev $IFACE
  292. - ip link set $IFACE up
  293. down_cmds:
  294. - ip link set $IFACE down
  295. br-ex:
  296. enabled: true
  297. type: bridge
  298. address: ${linux:network:host:public_local:address}
  299. netmask: 255.255.255.0
  300. use_interfaces:
  301. - eth1
  302. Linux with proxy
  303. .. code-block:: yaml
  304. linux:
  305. network:
  306. ...
  307. proxy:
  308. host: proxy.domain.com
  309. port: 3128
  310. Linux with hosts
  311. .. code-block:: yaml
  312. linux:
  313. network:
  314. ...
  315. host:
  316. node1:
  317. address: 192.168.10.200
  318. names:
  319. - node2.domain.com
  320. - service2.domain.com
  321. node2:
  322. address: 192.168.10.201
  323. names:
  324. - node2.domain.com
  325. - service2.domain.com
  326. Setup resolv.conf, nameservers, domain and search domains
  327. .. code-block:: yaml
  328. linux:
  329. network:
  330. resolv:
  331. dns:
  332. - 8.8.4.4
  333. - 8.8.8.8
  334. domain: my.example.com
  335. search:
  336. - my.example.com
  337. - example.com
  338. Linux storage pillars
  339. ---------------------
  340. Linux with mounted Samba
  341. .. code-block:: yaml
  342. linux:
  343. storage:
  344. enabled: true
  345. mount:
  346. samba1:
  347. - path: /media/myuser/public/
  348. - device: //192.168.0.1/storage
  349. - file_system: cifs
  350. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  351. Linux with file swap
  352. .. code-block:: yaml
  353. linux:
  354. storage:
  355. enabled: true
  356. swap:
  357. file:
  358. enabled: true
  359. engine: file
  360. device: /swapfile
  361. size: 1024
  362. LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
  363. .. code-block:: yaml
  364. parameters:
  365. linux:
  366. storage:
  367. mount:
  368. data:
  369. device: /dev/vg1/data
  370. file_system: ext4
  371. path: /mnt/data
  372. lvm:
  373. vg1:
  374. enabled: true
  375. devices:
  376. - /dev/sdb
  377. volume:
  378. data:
  379. size: 40G
  380. mount: ${linux:storage:mount:data}
  381. Usage
  382. =====
  383. Set mtu of network interface eth0 to 1400
  384. .. code-block:: bash
  385. ip link set dev eth0 mtu 1400
  386. Read more
  387. =========
  388. * https://www.archlinux.org/
  389. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu