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.

214 lines
5.2KB

  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. ] %}
  93. {% set network = salt['grains.filter_by']({
  94. 'Arch': {
  95. 'pkgs': ['wpa_supplicant', 'dhclient', 'wireless_tools'],
  96. 'bridge_pkgs': ['bridge-utils'],
  97. 'ovs_pkgs': ['openvswitch-switch'],
  98. 'hostname_file': '/etc/hostname',
  99. 'network_manager': False,
  100. 'interface': {},
  101. 'interface_params': interface_params,
  102. 'bridge': 'none',
  103. 'proxy': {
  104. 'host': 'none',
  105. },
  106. 'host': {},
  107. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  108. },
  109. 'Debian': {
  110. 'hostname_file': '/etc/hostname',
  111. 'bridge_pkgs': ['bridge-utils'],
  112. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  113. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-dkms', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  114. 'network_manager': False,
  115. 'interface': {},
  116. 'interface_params': interface_params,
  117. 'bridge': 'none',
  118. 'proxy': {
  119. 'host': 'none'
  120. },
  121. 'host': {},
  122. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  123. },
  124. 'RedHat': {
  125. 'bridge_pkgs': ['bridge-utils'],
  126. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  127. 'hostname_file': '/etc/sysconfig/network',
  128. 'network_manager': False,
  129. 'interface': {},
  130. 'interface_params': interface_params,
  131. 'bridge': 'none',
  132. 'proxy': {
  133. 'host': 'none'
  134. },
  135. 'host': {},
  136. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  137. },
  138. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  139. {% set storage = salt['grains.filter_by']({
  140. 'Arch': {
  141. 'mount': {},
  142. 'swap': {},
  143. 'lvm': {},
  144. 'loopback': {},
  145. 'nfs': {
  146. 'pkgs': ['nfs-utils']
  147. },
  148. 'multipath': {
  149. 'enabled': False,
  150. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  151. 'service': ''
  152. },
  153. },
  154. 'Debian': {
  155. 'mount': {},
  156. 'swap': {},
  157. 'lvm': {},
  158. 'loopback': {},
  159. 'nfs': {
  160. 'pkgs': ['nfs-common']
  161. },
  162. 'multipath': {
  163. 'enabled': False,
  164. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  165. 'service': 'multipath-tools'
  166. },
  167. 'lvm_pkgs': ['lvm2'],
  168. },
  169. 'RedHat': {
  170. 'mount': {},
  171. 'swap': {},
  172. 'lvm': {},
  173. 'loopback': {},
  174. 'nfs': {
  175. 'pkgs': ['nfs-utils']
  176. },
  177. 'multipath': {
  178. 'enabled': False,
  179. 'pkgs': [],
  180. 'service': 'multipath'
  181. },
  182. },
  183. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  184. {% set monitoring = salt['grains.filter_by']({
  185. 'default': {
  186. 'zombie': {
  187. 'warn': 3,
  188. 'crit': 7,
  189. },
  190. 'procs': {
  191. 'warn': 5000,
  192. 'crit': 10000,
  193. },
  194. 'load': {
  195. 'warn': '6,4,2',
  196. 'crit': '12,8,4',
  197. },
  198. 'swap': {
  199. 'warn': '50%',
  200. 'crit': '20%',
  201. },
  202. 'disk': {
  203. 'warn': '15%',
  204. 'crit': '5%',
  205. },
  206. },
  207. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}