Saltstack Official Linux Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

318 lines
8.1KB

  1. {% set system = salt['grains.filter_by']({
  2. 'Arch': {
  3. 'pkgs': ['sudo', 'vim', 'wget'],
  4. 'utc': true,
  5. 'user': {},
  6. 'group': {},
  7. 'job': {},
  8. 'limit': {},
  9. 'locale': {},
  10. 'motd': {},
  11. 'env': {},
  12. 'profile': {},
  13. 'proxy': {},
  14. 'repo': {},
  15. 'package': {},
  16. 'autoupdates': {
  17. 'pkgs': []
  18. },
  19. 'selinux': 'permissive',
  20. 'ca_certs_dir': '/usr/local/share/ca-certificates',
  21. 'ca_certs_bin': 'update-ca-certificates',
  22. 'atop': {
  23. 'enabled': false,
  24. 'interval': '20',
  25. 'autostart': true,
  26. 'logpath': '/var/log/atop',
  27. 'outfile': '/var/log/atop/daily.log'
  28. },
  29. },
  30. 'Debian': {
  31. 'pkgs': ['python-apt', 'apt-transport-https', 'libmnl0'],
  32. 'utc': true,
  33. 'user': {},
  34. 'group': {},
  35. 'job': {},
  36. 'limit': {},
  37. 'locale': {},
  38. 'motd': {},
  39. 'env': {},
  40. 'profile': {},
  41. 'proxy': {},
  42. 'repo': {},
  43. 'package': {},
  44. 'autoupdates': {
  45. 'pkgs': ['unattended-upgrades']
  46. },
  47. 'selinux': 'permissive',
  48. 'ca_certs_dir': '/usr/local/share/ca-certificates',
  49. 'ca_certs_bin': 'update-ca-certificates',
  50. 'atop': {
  51. 'enabled': false,
  52. 'interval': '20',
  53. 'autostart': true,
  54. 'logpath': '/var/log/atop',
  55. 'outfile': '/var/log/atop/daily.log'
  56. },
  57. },
  58. 'RedHat': {
  59. 'pkgs': ['policycoreutils', 'policycoreutils-python', 'telnet', 'wget'],
  60. 'utc': true,
  61. 'user': {},
  62. 'group': {},
  63. 'job': {},
  64. 'limit': {},
  65. 'locale': {},
  66. 'motd': {},
  67. 'env': {},
  68. 'profile': {},
  69. 'proxy': {},
  70. 'repo': {},
  71. 'package': {},
  72. 'autoupdates': {
  73. 'pkgs': []
  74. },
  75. 'selinux': 'permissive',
  76. 'ca_certs_dir': '/etc/pki/ca-trust/source/anchors',
  77. 'ca_certs_bin': 'update-ca-trust extract',
  78. 'atop': {
  79. 'enabled': false,
  80. 'interval': '20',
  81. 'autostart': true,
  82. 'logpath': '/var/log/atop',
  83. 'outfile': '/var/log/atop/daily.log'
  84. },
  85. },
  86. }, grain='os_family', merge=salt['pillar.get']('linux:system')) %}
  87. {% set auth = salt['grains.filter_by']({
  88. 'Arch': {
  89. 'enabled': false,
  90. },
  91. 'RedHat': {
  92. 'enabled': false,
  93. },
  94. 'Debian': {
  95. 'enabled': false,
  96. },
  97. }, grain='os_family', merge=salt['pillar.get']('linux:system:auth')) %}
  98. {% set ldap = salt['grains.filter_by']({
  99. 'RedHat': {
  100. 'enabled': false,
  101. 'pkgs': ['openldap-clients', 'nss-pam-ldapd', 'authconfig'],
  102. 'version': '3',
  103. 'scope': 'sub',
  104. 'uid': 'nslcd',
  105. 'gid': 'nslcd',
  106. },
  107. 'Debian': {
  108. 'enabled': false,
  109. 'pkgs': ['libnss-ldapd', 'libpam-ldapd'],
  110. 'version': '3',
  111. 'scope': 'sub',
  112. 'uid': 'nslcd',
  113. 'gid': 'nslcd',
  114. },
  115. }, grain='os_family', merge=salt['pillar.get']('linux:system:auth:ldap')) %}
  116. {# 'network_name', #}
  117. {% set interface_params = [
  118. 'gateway',
  119. 'mtu',
  120. 'network',
  121. 'broadcast',
  122. 'master',
  123. 'miimon',
  124. 'ovs_ports',
  125. 'ovs_bridge',
  126. 'mode',
  127. 'port_type',
  128. 'peer',
  129. 'lacp-rate',
  130. 'dns-search',
  131. 'up_cmds',
  132. 'pre_up_cmds',
  133. 'post_up_cmds',
  134. 'down_cmds',
  135. 'pre_down_cmds',
  136. 'post_down_cmds',
  137. 'maxwait',
  138. 'stp',
  139. 'gro',
  140. 'lacp_rate',
  141. 'ad_select',
  142. 'downdelay',
  143. 'updelay',
  144. 'hashing-algorithm',
  145. 'hardware-dma-ring-rx',
  146. 'hwaddr',
  147. 'noifupdown',
  148. 'arp_ip_target',
  149. 'primary',
  150. ] %}
  151. {% set network = salt['grains.filter_by']({
  152. 'Arch': {
  153. 'pkgs': ['wpa_supplicant', 'dhclient', 'wireless_tools', 'ifenslave'],
  154. 'bridge_pkgs': ['bridge-utils'],
  155. 'ovs_pkgs': ['openvswitch-switch'],
  156. 'hostname_file': '/etc/hostname',
  157. 'network_manager': False,
  158. 'systemd': {},
  159. 'interface': {},
  160. 'interface_params': interface_params,
  161. 'bridge': 'none',
  162. 'proxy': {
  163. 'host': 'none',
  164. },
  165. 'host': {},
  166. 'mine_dns_records': False,
  167. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  168. },
  169. 'Debian': {
  170. 'pkgs': ['ifenslave'],
  171. 'hostname_file': '/etc/hostname',
  172. 'bridge_pkgs': ['bridge-utils'],
  173. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  174. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  175. 'network_manager': False,
  176. 'systemd': {},
  177. 'interface': {},
  178. 'interface_params': interface_params,
  179. 'bridge': 'none',
  180. 'proxy': {
  181. 'host': 'none'
  182. },
  183. 'host': {},
  184. 'mine_dns_records': False,
  185. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  186. },
  187. 'RedHat': {
  188. 'pkgs': ['iputils'],
  189. 'bridge_pkgs': ['bridge-utils'],
  190. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  191. 'hostname_file': '/etc/sysconfig/network',
  192. 'network_manager': False,
  193. 'systemd': {},
  194. 'interface': {},
  195. 'interface_params': interface_params,
  196. 'bridge': 'none',
  197. 'proxy': {
  198. 'host': 'none'
  199. },
  200. 'host': {},
  201. 'mine_dns_records': False,
  202. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  203. },
  204. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  205. {% set storage = salt['grains.filter_by']({
  206. 'Arch': {
  207. 'mount': {},
  208. 'swap': {},
  209. 'disk': {},
  210. 'lvm': {},
  211. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  212. 'loopback': {},
  213. 'nfs': {
  214. 'pkgs': ['nfs-utils']
  215. },
  216. 'multipath': {
  217. 'enabled': False,
  218. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  219. 'service': ''
  220. },
  221. },
  222. 'Debian': {
  223. 'mount': {},
  224. 'swap': {},
  225. 'lvm': {},
  226. 'disk': {},
  227. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  228. 'loopback': {},
  229. 'nfs': {
  230. 'pkgs': ['nfs-common']
  231. },
  232. 'multipath': {
  233. 'enabled': False,
  234. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  235. 'service': 'multipath-tools'
  236. },
  237. 'lvm_pkgs': ['lvm2'],
  238. },
  239. 'RedHat': {
  240. 'mount': {},
  241. 'swap': {},
  242. 'lvm': {},
  243. 'disk': {},
  244. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  245. 'loopback': {},
  246. 'nfs': {
  247. 'pkgs': ['nfs-utils']
  248. },
  249. 'multipath': {
  250. 'enabled': False,
  251. 'pkgs': [],
  252. 'service': 'multipath'
  253. },
  254. },
  255. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  256. {% set monitoring = salt['grains.filter_by']({
  257. 'default': {
  258. 'zombie': {
  259. 'warn': 3,
  260. 'crit': 7,
  261. },
  262. 'procs': {
  263. 'warn': 5000,
  264. 'crit': 10000,
  265. },
  266. 'load': {
  267. 'warn': '6,4,2',
  268. 'crit': '12,8,4',
  269. },
  270. 'swap': {
  271. 'warn': '50%',
  272. 'crit': '20%',
  273. },
  274. 'disk': {
  275. 'warn': '15%',
  276. 'crit': '5%',
  277. },
  278. 'netlink': {
  279. 'interfaces': [],
  280. 'interface_regex': '^[a-z0-9]+$',
  281. 'ignore_selected': False,
  282. },
  283. 'bond_status': {
  284. 'interfaces': False
  285. },
  286. 'cpu_idle_percentage': {
  287. 'warn': 10.0,
  288. },
  289. 'free_memory_percentage': {
  290. 'warn': 10.0,
  291. 'crit': 5.0,
  292. },
  293. 'load_5': {
  294. 'warn': 3,
  295. },
  296. 'rx_packets_dropped_rate': {
  297. 'warn': 100,
  298. },
  299. 'tx_packets_dropped_rate': {
  300. 'warn': 100,
  301. },
  302. 'swap_in_rate': {
  303. 'warn': 1024 * 1024,
  304. },
  305. 'swap_out_rate': {
  306. 'warn': 1024 * 1024,
  307. },
  308. },
  309. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}