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.

279 lines
7.0KB

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