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.

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