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.

217 lines
5.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. 'doc_validity_pkgs': ['python-yaml'],
  22. },
  23. 'Debian': {
  24. 'pkgs': ['python-apt', 'apt-transport-https', 'libmnl0'],
  25. 'utc': true,
  26. 'user': {},
  27. 'group': {},
  28. 'job': {},
  29. 'limit': {},
  30. 'locale': {},
  31. 'motd': {},
  32. 'env': {},
  33. 'profile': {},
  34. 'proxy': {},
  35. 'repo': {},
  36. 'package': {},
  37. 'autoupdates': {
  38. 'pkgs': ['unattended-upgrades']
  39. },
  40. 'selinux': 'permissive',
  41. 'ca_certs_dir': '/usr/local/share/ca-certificates',
  42. 'doc_validity_pkgs': ['python-yaml'],
  43. },
  44. 'RedHat': {
  45. 'pkgs': ['policycoreutils', 'policycoreutils-python', 'telnet', 'wget'],
  46. 'utc': true,
  47. 'user': {},
  48. 'group': {},
  49. 'job': {},
  50. 'limit': {},
  51. 'locale': {},
  52. 'motd': {},
  53. 'env': {},
  54. 'profile': {},
  55. 'proxy': {},
  56. 'repo': {},
  57. 'package': {},
  58. 'autoupdates': {
  59. 'pkgs': []
  60. },
  61. 'selinux': 'permissive',
  62. 'ca_certs_dir': '/usr/local/share/ca-certificates',
  63. 'doc_validity_pkgs': ['PyYAML'],
  64. },
  65. }, grain='os_family', merge=salt['pillar.get']('linux:system')) %}
  66. {# 'network_name', #}
  67. {% set interface_params = [
  68. 'gateway',
  69. 'mtu',
  70. 'network',
  71. 'broadcast',
  72. 'master',
  73. 'miimon',
  74. 'ovs_ports',
  75. 'ovs_bridge',
  76. 'mode',
  77. 'port_type',
  78. 'peer',
  79. 'lacp-rate',
  80. 'dns-search',
  81. 'up_cmds',
  82. 'pre_up_cmds',
  83. 'post_up_cmds',
  84. 'down_cmds',
  85. 'pre_down_cmds',
  86. 'post_down_cmds',
  87. 'maxwait',
  88. 'stp',
  89. 'gro',
  90. 'lacp_rate',
  91. 'ad_select',
  92. 'downdelay',
  93. 'updelay',
  94. 'hashing-algorithm',
  95. ] %}
  96. {% set network = salt['grains.filter_by']({
  97. 'Arch': {
  98. 'pkgs': ['wpa_supplicant', 'dhclient', 'wireless_tools'],
  99. 'bridge_pkgs': ['bridge-utils'],
  100. 'ovs_pkgs': ['openvswitch-switch'],
  101. 'hostname_file': '/etc/hostname',
  102. 'network_manager': False,
  103. 'interface': {},
  104. 'interface_params': interface_params,
  105. 'bridge': 'none',
  106. 'proxy': {
  107. 'host': 'none',
  108. },
  109. 'host': {},
  110. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  111. },
  112. 'Debian': {
  113. 'hostname_file': '/etc/hostname',
  114. 'bridge_pkgs': ['bridge-utils'],
  115. 'ovs_pkgs': ['openvswitch-switch', 'bridge-utils'],
  116. 'dpdk_pkgs': ['dpdk', 'dpdk-dev', 'dpdk-dkms', 'dpdk-igb-uio-dkms', 'dpdk-rte-kni-dkms'],
  117. 'network_manager': False,
  118. 'interface': {},
  119. 'interface_params': interface_params,
  120. 'bridge': 'none',
  121. 'proxy': {
  122. 'host': 'none'
  123. },
  124. 'host': {},
  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. 'dhclient_config': '/etc/dhcp/dhclient.conf',
  140. },
  141. }, grain='os_family', merge=salt['pillar.get']('linux:network')) %}
  142. {% set storage = salt['grains.filter_by']({
  143. 'Arch': {
  144. 'mount': {},
  145. 'swap': {},
  146. 'lvm': {},
  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. 'loopback': {},
  162. 'nfs': {
  163. 'pkgs': ['nfs-common']
  164. },
  165. 'multipath': {
  166. 'enabled': False,
  167. 'pkgs': ['multipath-tools', 'multipath-tools-boot'],
  168. 'service': 'multipath-tools'
  169. },
  170. 'lvm_pkgs': ['lvm2'],
  171. },
  172. 'RedHat': {
  173. 'mount': {},
  174. 'swap': {},
  175. 'lvm': {},
  176. 'loopback': {},
  177. 'nfs': {
  178. 'pkgs': ['nfs-utils']
  179. },
  180. 'multipath': {
  181. 'enabled': False,
  182. 'pkgs': [],
  183. 'service': 'multipath'
  184. },
  185. },
  186. }, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}
  187. {% set monitoring = salt['grains.filter_by']({
  188. 'default': {
  189. 'zombie': {
  190. 'warn': 3,
  191. 'crit': 7,
  192. },
  193. 'procs': {
  194. 'warn': 5000,
  195. 'crit': 10000,
  196. },
  197. 'load': {
  198. 'warn': '6,4,2',
  199. 'crit': '12,8,4',
  200. },
  201. 'swap': {
  202. 'warn': '50%',
  203. 'crit': '20%',
  204. },
  205. 'disk': {
  206. 'warn': '15%',
  207. 'crit': '5%',
  208. },
  209. },
  210. }, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}