Saltstack Official Linux Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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. Linux network
  154. -------------
  155. Linux with network manager
  156. .. code-block:: yaml
  157. linux:
  158. network:
  159. enabled: true
  160. network_manager: true
  161. Linux with default static network interfaces, default gateway interface and DNS servers
  162. .. code-block:: yaml
  163. linux:
  164. network:
  165. enabled: true
  166. interface:
  167. eth0:
  168. enabled: true
  169. type: eth
  170. address: 192.168.0.102
  171. netmask: 255.255.255.0
  172. gateway: 192.168.0.1
  173. name_servers:
  174. - 8.8.8.8
  175. - 8.8.4.4
  176. mtu: 1500
  177. Linux with bonded interfaces
  178. .. code-block:: yaml
  179. linux:
  180. network:
  181. enabled: true
  182. interface:
  183. eth0:
  184. type: eth
  185. ...
  186. eth1:
  187. type: eth
  188. ...
  189. bond0:
  190. enabled: true
  191. type: bond
  192. address: 192.168.0.102
  193. netmask: 255.255.255.0
  194. mtu: 1500
  195. use_in:
  196. - interface: ${linux:interface:eth0}
  197. - interface: ${linux:interface:eth0}
  198. Linux with vlan interface_params
  199. .. code-block:: yaml
  200. linux:
  201. network:
  202. enabled: true
  203. interface:
  204. vlan69:
  205. type: vlan
  206. use_interfaces:
  207. - interface: ${linux:interface:bond0}
  208. Linux with wireless interface parameters
  209. .. code-block:: yaml
  210. linux:
  211. network:
  212. enabled: true
  213. gateway: 10.0.0.1
  214. default_interface: eth0
  215. interface:
  216. wlan0:
  217. type: eth
  218. wireless:
  219. essid: example
  220. key: example_key
  221. security: wpa
  222. priority: 1
  223. Linux networks with routes defined
  224. .. code-block:: yaml
  225. linux:
  226. network:
  227. enabled: true
  228. gateway: 10.0.0.1
  229. default_interface: eth0
  230. interface:
  231. eth0:
  232. type: eth
  233. route:
  234. default:
  235. address: 192.168.0.123
  236. netmask: 255.255.255.0
  237. gateway: 192.168.0.1
  238. Native Linux Bridges
  239. .. code-block:: yaml
  240. linux:
  241. network:
  242. interface:
  243. eth1:
  244. enabled: true
  245. type: eth
  246. proto: manual
  247. up_cmds:
  248. - ip address add 0/0 dev $IFACE
  249. - ip link set $IFACE up
  250. down_cmds:
  251. - ip link set $IFACE down
  252. br-ex:
  253. enabled: true
  254. type: bridge
  255. address: ${linux:network:host:public_local:address}
  256. netmask: 255.255.255.0
  257. use_interfaces:
  258. - eth1
  259. OpenVswitch Bridges
  260. .. code-block:: yaml
  261. linux:
  262. network:
  263. bridge: openvswitch
  264. interface:
  265. eth1:
  266. enabled: true
  267. type: eth
  268. proto: manual
  269. up_cmds:
  270. - ip address add 0/0 dev $IFACE
  271. - ip link set $IFACE up
  272. down_cmds:
  273. - ip link set $IFACE down
  274. br-ex:
  275. enabled: true
  276. type: bridge
  277. address: ${linux:network:host:public_local:address}
  278. netmask: 255.255.255.0
  279. use_interfaces:
  280. - eth1
  281. Linux with proxy
  282. .. code-block:: yaml
  283. linux:
  284. network:
  285. ...
  286. proxy:
  287. host: proxy.domain.com
  288. port: 3128
  289. Linux with hosts
  290. .. code-block:: yaml
  291. linux:
  292. network:
  293. ...
  294. host:
  295. node1:
  296. address: 192.168.10.200
  297. names:
  298. - node2.domain.com
  299. - service2.domain.com
  300. node2:
  301. address: 192.168.10.201
  302. names:
  303. - node2.domain.com
  304. - service2.domain.com
  305. Setup resolv.conf, nameservers, domain and search domains
  306. .. code-block:: yaml
  307. linux:
  308. network:
  309. resolv:
  310. dns:
  311. - 8.8.4.4
  312. - 8.8.8.8
  313. domain: my.example.com
  314. search:
  315. - my.example.com
  316. - example.com
  317. Linux storage pillars
  318. ---------------------
  319. Linux with mounted Samba
  320. .. code-block:: yaml
  321. linux:
  322. storage:
  323. enabled: true
  324. mount:
  325. samba1:
  326. - path: /media/myuser/public/
  327. - device: //192.168.0.1/storage
  328. - file_system: cifs
  329. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  330. Linux with file swap
  331. .. code-block:: yaml
  332. linux:
  333. storage:
  334. enabled: true
  335. swap:
  336. file:
  337. enabled: true
  338. engine: file
  339. device: /swapfile
  340. size: 1024
  341. LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
  342. .. code-block:: yaml
  343. parameters:
  344. linux:
  345. storage:
  346. mount:
  347. data:
  348. device: /dev/vg1/data
  349. file_system: ext4
  350. path: /mnt/data
  351. lvm:
  352. vg1:
  353. enabled: true
  354. devices:
  355. - /dev/sdb
  356. volume:
  357. data:
  358. size: 40G
  359. mount: ${linux:storage:mount:data}
  360. Usage
  361. =====
  362. Set mtu of network interface eth0 to 1400
  363. .. code-block:: bash
  364. ip link set dev eth0 mtu 1400
  365. Read more
  366. =========
  367. * https://www.archlinux.org/
  368. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu