Saltstack Official Linux Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

285 行
7.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. {# 'network_name', #}
  88. {% set interface_params = [
  89. 'gateway',
  90. 'mtu',
  91. 'network',
  92. 'broadcast',
  93. 'master',
  94. 'miimon',
  95. 'ovs_ports',
  96. 'ovs_bridge',
  97. 'mode',
  98. 'port_type',
  99. 'peer',
  100. 'lacp-rate',
  101. 'dns-search',
  102. 'up_cmds',
  103. 'pre_up_cmds',
  104. 'post_up_cmds',
  105. 'down_cmds',
  106. 'pre_down_cmds',
  107. 'post_down_cmds',
  108. 'maxwait',
  109. 'stp',
  110. 'gro',
  111. 'lacp_rate',
  112. 'ad_select',
  113. 'downdelay',
  114. 'updelay',
  115. 'hashing-algorithm',
  116. 'hardware-dma-ring-rx',
  117. 'hwaddr',
  118. 'noifupdown',
  119. ] %}
  120. {% set network = salt['grains.filter_by']({
  121. 'Arch': {
  122. 'pkgs': ['wpa_supplicant', 'dhclient', 'wireless_tools', 'ifenslave'],
  123. 'bridge_pkgs': ['bridge-utils'],
  124. 'ovs_pkgs': ['openvswitch-switch'],
  125. 'hostname_file': '/etc/hostname',
  126. 'network_manager': False,
  127. 'systemd': {},
  128. 'interface': {},
  129. 'interface_params': interface_params,
  130. 'bridge': 'none',
  131. 'proxy': {
  132. 'host': 'none',
  133. },
  134. 'host': {},
  135. 'mine_dns_records': False,
  136. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  137. },
  138. 'Debian': {
  139. 'pkgs': ['ifenslave'],
  140. 'hostname_file': '/etc/hostname',
  141. 'bridge_pkgs': ['bridge-utils'],
  142. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  143. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-dkms', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  144. 'network_manager': False,
  145. 'systemd': {},
  146. 'interface': {},
  147. 'interface_params': interface_params,
  148. 'bridge': 'none',
  149. 'proxy': {
  150. 'host': 'none'
  151. },
  152. 'host': {},
  153. 'mine_dns_records': False,
  154. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  155. },
  156. 'RedHat': {
  157. 'pkgs': ['iputils'],
  158. 'bridge_pkgs': ['bridge-utils'],
  159. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  160. 'hostname_file': '/etc/sysconfig/network',
  161. 'network_manager': False,
  162. 'systemd': {},
  163. 'interface': {},
  164. 'interface_params': interface_params,
  165. 'bridge': 'none',
  166. 'proxy': {
  167. 'host': 'none'
  168. },
  169. 'host': {},
  170. 'mine_dns_records': False,
  171. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  172. },
  173. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  174. {% set storage = salt['grains.filter_by']({
  175. 'Arch': {
  176. 'mount': {},
  177. 'swap': {},
  178. 'disk': {},
  179. 'lvm': {},
  180. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  181. 'loopback': {},
  182. 'nfs': {
  183. 'pkgs': ['nfs-utils']
  184. },
  185. 'multipath': {
  186. 'enabled': False,
  187. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  188. 'service': ''
  189. },
  190. },
  191. 'Debian': {
  192. 'mount': {},
  193. 'swap': {},
  194. 'lvm': {},
  195. 'disk': {},
  196. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  197. 'loopback': {},
  198. 'nfs': {
  199. 'pkgs': ['nfs-common']
  200. },
  201. 'multipath': {
  202. 'enabled': False,
  203. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  204. 'service': 'multipath-tools'
  205. },
  206. 'lvm_pkgs': ['lvm2'],
  207. },
  208. 'RedHat': {
  209. 'mount': {},
  210. 'swap': {},
  211. 'lvm': {},
  212. 'disk': {},
  213. 'lvm_services': ['lvm2-lvmetad', 'lvm2-lvmpolld', 'lvm2-monitor'],
  214. 'loopback': {},
  215. 'nfs': {
  216. 'pkgs': ['nfs-utils']
  217. },
  218. 'multipath': {
  219. 'enabled': False,
  220. 'pkgs': [],
  221. 'service': 'multipath'
  222. },
  223. },
  224. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  225. {% set monitoring = salt['grains.filter_by']({
  226. 'default': {
  227. 'zombie': {
  228. 'warn': 3,
  229. 'crit': 7,
  230. },
  231. 'procs': {
  232. 'warn': 5000,
  233. 'crit': 10000,
  234. },
  235. 'load': {
  236. 'warn': '6,4,2',
  237. 'crit': '12,8,4',
  238. },
  239. 'swap': {
  240. 'warn': '50%',
  241. 'crit': '20%',
  242. },
  243. 'disk': {
  244. 'warn': '15%',
  245. 'crit': '5%',
  246. },
  247. 'netlink': {
  248. 'interfaces': [],
  249. 'interface_regex': '^[a-z0-9]+$',
  250. 'ignore_selected': False,
  251. },
  252. 'bond_status': {
  253. 'interfaces': False
  254. },
  255. 'cpu_idle_percentage': {
  256. 'warn': 10.0,
  257. },
  258. 'free_memory_percentage': {
  259. 'warn': 10.0,
  260. 'crit': 5.0,
  261. },
  262. 'load_5': {
  263. 'warn': 3,
  264. },
  265. 'rx_packets_dropped_rate': {
  266. 'warn': 100,
  267. },
  268. 'tx_packets_dropped_rate': {
  269. 'warn': 100,
  270. },
  271. 'swap_in_rate': {
  272. 'warn': 1024 * 1024,
  273. },
  274. 'swap_out_rate': {
  275. 'warn': 1024 * 1024,
  276. },
  277. },
  278. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}