New Saltstack Salt formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

224 lines
4.8KB

  1. {%- load_yaml as master_common %}
  2. default:
  3. service: salt-master
  4. {%- if pillar.salt.get('master', {}).get('source', {}).get('engine', 'pkg') == 'pkg' %}
  5. install_state: "pkg: salt_master_packages"
  6. source:
  7. engine: pkg
  8. {%- elif pillar.salt.master.source.engine == 'pip' %}
  9. install_state: "pip: salt_master_packages"
  10. {%- endif %}
  11. {%- if pillar.salt.get('master', {}).get('source', {}).version is defined %}
  12. version: {{ pillar.salt.master.source.version }}
  13. {%- endif %}
  14. accept_policy: preseed
  15. bind: {}
  16. formula: {}
  17. base_environment: dev
  18. dir:
  19. files: /srv/salt/env
  20. pillar_safe_render_error: true
  21. pillar:
  22. engine: salt
  23. max_event_size: 100000000
  24. minion_data_cache: 'localfs'
  25. {%- endload %}
  26. {%- load_yaml as master_specific %}
  27. Arch:
  28. pkgs:
  29. - salt
  30. ddns_pkgs:
  31. - python-dnspython
  32. Debian:
  33. pkgs:
  34. - salt-master
  35. ddns_pkgs:
  36. - python-dnspython
  37. Gentoo:
  38. pkgs:
  39. - app-admin/salt
  40. MacOS:
  41. pkgs:
  42. - saltstack
  43. RedHat:
  44. pkgs:
  45. - salt-master
  46. ddns_pkgs:
  47. - python-dnspython
  48. {%- endload %}
  49. {%- if pillar.salt.master is defined %}
  50. {%- set raw_master = salt['grains.filter_by'](master_specific, merge=salt['pillar.get']('salt:master')) %}
  51. {%- set master = salt['grains.filter_by'](master_common, merge=raw_master) %}
  52. {%- endif %}
  53. {%- load_yaml as syndic_defaults %}
  54. Debian:
  55. service: salt-syndic
  56. pkgs:
  57. - salt-syndic
  58. RedHat:
  59. service: salt-syndic
  60. pkgs:
  61. - salt-syndic
  62. {%- endload %}
  63. {%- set syndic = salt['grains.filter_by'](syndic_defaults, merge=salt['pillar.get']('salt:syndic')) %}
  64. {%- load_yaml as minion_common %}
  65. default:
  66. graph_pkgs:
  67. - graphviz
  68. graph_states_pkgs:
  69. - python-pydot
  70. - python-yaml
  71. graph_states: False
  72. log:
  73. level: info
  74. service: salt-minion
  75. {%- if pillar.salt.get('minion', {}).get('source', {}).get('engine', 'pkg') == 'pkg' %}
  76. install_state: "pkg: salt_minion_packages"
  77. source:
  78. engine: pkg
  79. {%- elif pillar.salt.minion.source.engine == 'pip' %}
  80. install_state: "pip: salt_minion_packages"
  81. {%- endif %}
  82. {%- if pillar.salt.get('minion', {}).get('source', {}).version is defined %}
  83. version: {{ pillar.salt.minion.source.version }}
  84. {%- endif %}
  85. max_event_size: 100000000
  86. {%- endload %}
  87. {%- load_yaml as minion_specific %}
  88. Arch:
  89. pkgs:
  90. - salt
  91. Debian:
  92. pkgs:
  93. - salt-minion
  94. dependency_pkgs:
  95. - python-m2crypto
  96. - python-psutil
  97. - python-yaml
  98. - python-msgpack
  99. - python-oauth
  100. dependency_pkgs_pip:
  101. - PyYAML
  102. - M2Crypto
  103. - psutil
  104. - oauth
  105. cert_pkgs:
  106. - ca-certificates
  107. Gentoo:
  108. pkgs:
  109. - app-admin/salt
  110. MacOS:
  111. pkgs:
  112. - saltstack
  113. RedHat:
  114. pkgs:
  115. - salt-minion
  116. dependency_pkgs:
  117. - m2crypto
  118. - psutils
  119. - PyYAML
  120. - python-oauth
  121. dependency_pkgs_pip:
  122. - PyYAML
  123. - M2Crypto
  124. - psutil
  125. - oauth
  126. cert_pkgs:
  127. - ca-certificates
  128. {%- endload %}
  129. {%- if pillar.salt.minion is defined %}
  130. {%- set raw_minion = salt['grains.filter_by'](minion_specific, merge=salt['pillar.get']('salt:minion')) %}
  131. {%- set minion = salt['grains.filter_by'](minion_common, merge=raw_minion) %}
  132. {%- if pillar.salt.minion.proxy_minion is defined %}
  133. {% set proxy_minion = salt['grains.filter_by']({
  134. 'Debian': {
  135. 'napalm_pkgs': ['python-pip', 'libxml2-dev', 'libxslt1-dev', 'zlib1g-dev'],
  136. 'napalm_pip_pkgs': ['napalm', 'oauth']
  137. },
  138. 'RedHat': {
  139. 'napalm_pkgs': ['libxml2-dev', 'libxslt1-dev', 'zlib1g-dev']
  140. },
  141. }, merge=pillar.salt.minion.get('proxy_minion', {})) %}
  142. {%- endif %}
  143. {%- if pillar.salt.minion.env_vars is defined %}
  144. {% set env_vars = salt['grains.filter_by']({
  145. 'Debian': {
  146. 'engine': 'file'
  147. },
  148. 'RedHat': {
  149. 'engine': 'file'
  150. },
  151. }, merge=pillar.salt.minion.get('env_vars', {})) %}
  152. {%- endif %}
  153. {%- endif %}
  154. {%- load_yaml as api_common %}
  155. default:
  156. pkgs:
  157. - salt-api
  158. - python-cherrypy3
  159. service: salt-api
  160. {%- endload %}
  161. {%- set api = salt['grains.filter_by'](api_common, merge=salt['pillar.get']('salt:api')) %}
  162. {%- load_yaml as control_common %}
  163. default:
  164. cloud_pips:
  165. - apache-libcloud
  166. - netaddr
  167. cloud_pkgs:
  168. - python-netaddr
  169. - python-libcloud
  170. virt_pips:
  171. - libvirt-python
  172. maas_pkgs:
  173. - python-maas-client
  174. cluster: {}
  175. {%- endload %}
  176. {%- load_yaml as control_specific %}
  177. Debian:
  178. virt_pkgs:
  179. - libvirt-dev
  180. - pkg-config
  181. - genisoimage
  182. {% if grains.get('oscodename') == 'trusty' %}
  183. - libguestfs-tools
  184. {% endif %}
  185. virt_service: 'libvirt-bin'
  186. RedHat:
  187. virt_pkgs:
  188. - libvirt-dev
  189. - pkg-config
  190. - genisoimage
  191. virt_service: 'libvirtd'
  192. {%- endload %}
  193. {%- load_yaml as renderer_defaults %}
  194. default: {}
  195. {%- endload %}
  196. {%- set renderer = salt['grains.filter_by'](renderer_defaults, merge=salt['pillar.get']('salt:renderer')) %}
  197. {%- if pillar.salt.control is defined %}
  198. {%- set raw_control = salt['grains.filter_by'](control_specific, merge=salt['pillar.get']('salt:control')) %}
  199. {%- set control = salt['grains.filter_by'](control_common, merge=raw_control) %}
  200. {%- endif %}