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.

243 lines
6.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. },
  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. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  109. },
  110. 'Debian': {
  111. 'hostname_file': '/etc/hostname',
  112. 'bridge_pkgs': ['bridge-utils'],
  113. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  114. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-dkms', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  115. 'network_manager': False,
  116. 'interface': {},
  117. 'interface_params': interface_params,
  118. 'bridge': 'none',
  119. 'proxy': {
  120. 'host': 'none'
  121. },
  122. 'host': {},
  123. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  124. },
  125. 'RedHat': {
  126. 'bridge_pkgs': ['bridge-utils'],
  127. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  128. 'hostname_file': '/etc/sysconfig/network',
  129. 'network_manager': False,
  130. 'interface': {},
  131. 'interface_params': interface_params,
  132. 'bridge': 'none',
  133. 'proxy': {
  134. 'host': 'none'
  135. },
  136. 'host': {},
  137. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  138. },
  139. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  140. {% set storage = salt['grains.filter_by']({
  141. 'Arch': {
  142. 'mount': {},
  143. 'swap': {},
  144. 'disk': {},
  145. 'lvm': {},
  146. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  147. 'loopback': {},
  148. 'nfs': {
  149. 'pkgs': ['nfs-utils']
  150. },
  151. 'multipath': {
  152. 'enabled': False,
  153. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  154. 'service': ''
  155. },
  156. },
  157. 'Debian': {
  158. 'mount': {},
  159. 'swap': {},
  160. 'lvm': {},
  161. 'disk': {},
  162. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  163. 'loopback': {},
  164. 'nfs': {
  165. 'pkgs': ['nfs-common']
  166. },
  167. 'multipath': {
  168. 'enabled': False,
  169. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  170. 'service': 'multipath-tools'
  171. },
  172. 'lvm_pkgs': ['lvm2'],
  173. },
  174. 'RedHat': {
  175. 'mount': {},
  176. 'swap': {},
  177. 'lvm': {},
  178. 'disk': {},
  179. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  180. 'loopback': {},
  181. 'nfs': {
  182. 'pkgs': ['nfs-utils']
  183. },
  184. 'multipath': {
  185. 'enabled': False,
  186. 'pkgs': [],
  187. 'service': 'multipath'
  188. },
  189. },
  190. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  191. {% set monitoring = salt['grains.filter_by']({
  192. 'default': {
  193. 'zombie': {
  194. 'warn': 3,
  195. 'crit': 7,
  196. },
  197. 'procs': {
  198. 'warn': 5000,
  199. 'crit': 10000,
  200. },
  201. 'load': {
  202. 'warn': '6,4,2',
  203. 'crit': '12,8,4',
  204. },
  205. 'swap': {
  206. 'warn': '50%',
  207. 'crit': '20%',
  208. },
  209. 'disk': {
  210. 'warn': '15%',
  211. 'crit': '5%',
  212. },
  213. 'cpu_idle_percentage': {
  214. 'warn': 10.0,
  215. },
  216. 'free_memory_percentage': {
  217. 'warn': 10.0,
  218. 'crit': 5.0,
  219. },
  220. 'load_5': {
  221. 'warn': 3,
  222. },
  223. 'rx_packets_dropped_rate': {
  224. 'warn': 100,
  225. },
  226. 'tx_packets_dropped_rate': {
  227. 'warn': 100,
  228. },
  229. 'swap_in_rate': {
  230. 'warn': 1024 * 1024,
  231. },
  232. 'swap_out_rate': {
  233. 'warn': 1024 * 1024,
  234. },
  235. },
  236. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}