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.

328 lines
8.2KB

  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. 'rx',
  141. 'tx',
  142. 'sg',
  143. 'tso',
  144. 'ufo',
  145. 'gso',
  146. 'lro',
  147. 'lacp_rate',
  148. 'ad_select',
  149. 'downdelay',
  150. 'updelay',
  151. 'hashing-algorithm',
  152. 'hardware-dma-ring-rx',
  153. 'hwaddr',
  154. 'noifupdown',
  155. 'arp_ip_target',
  156. 'primary',
  157. ] %}
  158. {% set network = salt['grains.filter_by']({
  159. 'Arch': {
  160. 'pkgs': ['wpa_supplicant', 'dhclient', 'wireless_tools', 'ifenslave'],
  161. 'bridge_pkgs': ['bridge-utils'],
  162. 'ovs_pkgs': ['openvswitch-switch'],
  163. 'hostname_file': '/etc/hostname',
  164. 'network_manager': False,
  165. 'systemd': {},
  166. 'interface': {},
  167. 'interface_params': interface_params,
  168. 'bridge': 'none',
  169. 'proxy': {
  170. 'host': 'none',
  171. },
  172. 'host': {},
  173. 'mine_dns_records': False,
  174. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  175. 'ovs_nowait': False,
  176. },
  177. 'Debian': {
  178. 'pkgs': ['ifenslave'],
  179. 'hostname_file': '/etc/hostname',
  180. 'bridge_pkgs': ['bridge-utils'],
  181. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  182. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  183. 'network_manager': False,
  184. 'systemd': {},
  185. 'interface': {},
  186. 'interface_params': interface_params,
  187. 'bridge': 'none',
  188. 'proxy': {
  189. 'host': 'none'
  190. },
  191. 'host': {},
  192. 'mine_dns_records': False,
  193. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  194. 'ovs_nowait': False,
  195. },
  196. 'RedHat': {
  197. 'pkgs': ['iputils'],
  198. 'bridge_pkgs': ['bridge-utils'],
  199. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  200. 'hostname_file': '/etc/sysconfig/network',
  201. 'network_manager': False,
  202. 'systemd': {},
  203. 'interface': {},
  204. 'interface_params': interface_params,
  205. 'bridge': 'none',
  206. 'proxy': {
  207. 'host': 'none'
  208. },
  209. 'host': {},
  210. 'mine_dns_records': False,
  211. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  212. 'ovs_nowait': False,
  213. },
  214. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  215. {% set storage = salt['grains.filter_by']({
  216. 'Arch': {
  217. 'mount': {},
  218. 'swap': {},
  219. 'disk': {},
  220. 'lvm': {},
  221. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  222. 'loopback': {},
  223. 'nfs': {
  224. 'pkgs': ['nfs-utils']
  225. },
  226. 'multipath': {
  227. 'enabled': False,
  228. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  229. 'service': ''
  230. },
  231. },
  232. 'Debian': {
  233. 'mount': {},
  234. 'swap': {},
  235. 'lvm': {},
  236. 'disk': {},
  237. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  238. 'loopback': {},
  239. 'nfs': {
  240. 'pkgs': ['nfs-common']
  241. },
  242. 'multipath': {
  243. 'enabled': False,
  244. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  245. 'service': 'multipath-tools'
  246. },
  247. 'lvm_pkgs': ['lvm2'],
  248. },
  249. 'RedHat': {
  250. 'mount': {},
  251. 'swap': {},
  252. 'lvm': {},
  253. 'disk': {},
  254. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  255. 'loopback': {},
  256. 'nfs': {
  257. 'pkgs': ['nfs-utils']
  258. },
  259. 'multipath': {
  260. 'enabled': False,
  261. 'pkgs': [],
  262. 'service': 'multipath'
  263. },
  264. },
  265. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  266. {% set monitoring = salt['grains.filter_by']({
  267. 'default': {
  268. 'zombie': {
  269. 'warn': 3,
  270. 'crit': 7,
  271. },
  272. 'procs': {
  273. 'warn': 5000,
  274. 'crit': 10000,
  275. },
  276. 'load': {
  277. 'warn': '6,4,2',
  278. 'crit': '12,8,4',
  279. },
  280. 'swap': {
  281. 'warn': '50%',
  282. 'crit': '20%',
  283. },
  284. 'disk': {
  285. 'warn': '15%',
  286. 'crit': '5%',
  287. },
  288. 'netlink': {
  289. 'interfaces': [],
  290. 'interface_regex': '^[a-z0-9]+$',
  291. 'ignore_selected': False,
  292. },
  293. 'bond_status': {
  294. 'interfaces': False
  295. },
  296. 'cpu_idle_percentage': {
  297. 'warn': 10.0,
  298. },
  299. 'free_memory_percentage': {
  300. 'warn': 10.0,
  301. 'crit': 5.0,
  302. },
  303. 'load_5': {
  304. 'warn': 3,
  305. },
  306. 'rx_packets_dropped_rate': {
  307. 'warn': 100,
  308. },
  309. 'tx_packets_dropped_rate': {
  310. 'warn': 100,
  311. },
  312. 'swap_in_rate': {
  313. 'warn': 1024 * 1024,
  314. },
  315. 'swap_out_rate': {
  316. 'warn': 1024 * 1024,
  317. },
  318. },
  319. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}