New version of salt-formula from Saltstack
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.

218 lines
4.7KB

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