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

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