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 7.4KB

9 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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 wireless interface parameters
  179. .. code-block:: yaml
  180. linux:
  181. network:
  182. enabled: true
  183. gateway: 10.0.0.1
  184. default_interface: eth0
  185. interface:
  186. wlan0:
  187. type: eth
  188. wireless:
  189. essid: example
  190. key: example_key
  191. security: wpa
  192. priority: 1
  193. Linux networks with routes defined
  194. .. code-block:: yaml
  195. linux:
  196. network:
  197. enabled: true
  198. gateway: 10.0.0.1
  199. default_interface: eth0
  200. interface:
  201. eth0:
  202. type: eth
  203. route:
  204. default:
  205. address: 192.168.0.123
  206. netmask: 255.255.255.0
  207. gateway: 192.168.0.1
  208. Native Linux Bridges
  209. .. code-block:: yaml
  210. linux:
  211. network:
  212. interface:
  213. eth1:
  214. enabled: true
  215. type: eth
  216. proto: manual
  217. up_cmds:
  218. - ip address add 0/0 dev $IFACE
  219. - ip link set $IFACE up
  220. down_cmds:
  221. - ip link set $IFACE down
  222. br-ex:
  223. enabled: true
  224. type: bridge
  225. address: ${linux:network:host:public_local:address}
  226. netmask: 255.255.255.0
  227. use_interfaces:
  228. - eth1
  229. OpenVswitch Bridges
  230. .. code-block:: yaml
  231. linux:
  232. network:
  233. bridge: openvswitch
  234. interface:
  235. eth1:
  236. enabled: true
  237. type: eth
  238. proto: manual
  239. up_cmds:
  240. - ip address add 0/0 dev $IFACE
  241. - ip link set $IFACE up
  242. down_cmds:
  243. - ip link set $IFACE down
  244. br-ex:
  245. enabled: true
  246. type: bridge
  247. address: ${linux:network:host:public_local:address}
  248. netmask: 255.255.255.0
  249. use_interfaces:
  250. - eth1
  251. Linux with proxy
  252. .. code-block:: yaml
  253. linux:
  254. network:
  255. ...
  256. proxy:
  257. host: proxy.domain.com
  258. port: 3128
  259. Linux with hosts
  260. .. code-block:: yaml
  261. linux:
  262. network:
  263. ...
  264. host:
  265. node1:
  266. address: 192.168.10.200
  267. names:
  268. - node2.domain.com
  269. - service2.domain.com
  270. node2:
  271. address: 192.168.10.201
  272. names:
  273. - node2.domain.com
  274. - service2.domain.com
  275. Linux storage pillars
  276. ---------------------
  277. Linux with mounted Samba
  278. .. code-block:: yaml
  279. linux:
  280. storage:
  281. enabled: true
  282. mount:
  283. samba1:
  284. - path: /media/myuser/public/
  285. - device: //192.168.0.1/storage
  286. - file_system: cifs
  287. - options: guest,uid=myuser,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  288. Linux with file swap
  289. .. code-block:: yaml
  290. linux:
  291. storage:
  292. enabled: true
  293. swap:
  294. file:
  295. enabled: true
  296. engine: file
  297. device: /swapfile
  298. size: 1024
  299. Usage
  300. =====
  301. Set mtu of network interface eth0 to 1400
  302. .. code-block:: bash
  303. ip link set dev eth0 mtu 1400
  304. Read more
  305. =========
  306. * https://www.archlinux.org/
  307. * http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu