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.

281 lines
7.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. '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', 'ifenslave'],
  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. 'pkgs': ['ifenslave'],
  136. 'hostname_file': '/etc/hostname',
  137. 'bridge_pkgs': ['bridge-utils'],
  138. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  139. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-dkms', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  140. 'network_manager': False,
  141. 'systemd': {},
  142. 'interface': {},
  143. 'interface_params': interface_params,
  144. 'bridge': 'none',
  145. 'proxy': {
  146. 'host': 'none'
  147. },
  148. 'host': {},
  149. 'mine_dns_records': False,
  150. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  151. },
  152. 'RedHat': {
  153. 'pkgs': ['iputils'],
  154. 'bridge_pkgs': ['bridge-utils'],
  155. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  156. 'hostname_file': '/etc/sysconfig/network',
  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. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  170. {% set storage = salt['grains.filter_by']({
  171. 'Arch': {
  172. 'mount': {},
  173. 'swap': {},
  174. 'disk': {},
  175. 'lvm': {},
  176. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  177. 'loopback': {},
  178. 'nfs': {
  179. 'pkgs': ['nfs-utils']
  180. },
  181. 'multipath': {
  182. 'enabled': False,
  183. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  184. 'service': ''
  185. },
  186. },
  187. 'Debian': {
  188. 'mount': {},
  189. 'swap': {},
  190. 'lvm': {},
  191. 'disk': {},
  192. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  193. 'loopback': {},
  194. 'nfs': {
  195. 'pkgs': ['nfs-common']
  196. },
  197. 'multipath': {
  198. 'enabled': False,
  199. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  200. 'service': 'multipath-tools'
  201. },
  202. 'lvm_pkgs': ['lvm2'],
  203. },
  204. 'RedHat': {
  205. 'mount': {},
  206. 'swap': {},
  207. 'lvm': {},
  208. 'disk': {},
  209. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  210. 'loopback': {},
  211. 'nfs': {
  212. 'pkgs': ['nfs-utils']
  213. },
  214. 'multipath': {
  215. 'enabled': False,
  216. 'pkgs': [],
  217. 'service': 'multipath'
  218. },
  219. },
  220. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  221. {% set monitoring = salt['grains.filter_by']({
  222. 'default': {
  223. 'zombie': {
  224. 'warn': 3,
  225. 'crit': 7,
  226. },
  227. 'procs': {
  228. 'warn': 5000,
  229. 'crit': 10000,
  230. },
  231. 'load': {
  232. 'warn': '6,4,2',
  233. 'crit': '12,8,4',
  234. },
  235. 'swap': {
  236. 'warn': '50%',
  237. 'crit': '20%',
  238. },
  239. 'disk': {
  240. 'warn': '15%',
  241. 'crit': '5%',
  242. },
  243. 'netlink': {
  244. 'interfaces': [],
  245. 'interface_regex': '^[a-z0-9]+$',
  246. 'ignore_selected': False,
  247. },
  248. 'bond_status': {
  249. 'interfaces': False
  250. },
  251. 'cpu_idle_percentage': {
  252. 'warn': 10.0,
  253. },
  254. 'free_memory_percentage': {
  255. 'warn': 10.0,
  256. 'crit': 5.0,
  257. },
  258. 'load_5': {
  259. 'warn': 3,
  260. },
  261. 'rx_packets_dropped_rate': {
  262. 'warn': 100,
  263. },
  264. 'tx_packets_dropped_rate': {
  265. 'warn': 100,
  266. },
  267. 'swap_in_rate': {
  268. 'warn': 1024 * 1024,
  269. },
  270. 'swap_out_rate': {
  271. 'warn': 1024 * 1024,
  272. },
  273. },
  274. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}