New version of salt-formula from Saltstack
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

184 lines
3.9KB

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