Saltstack Official Linux Formula
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

README.rst 8.1KB

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