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.1KB

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