New version of salt-formula from Saltstack
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

186 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. grains_validity_pkgs:
  82. - python-yaml
  83. Debian:
  84. pkgs:
  85. - salt-minion
  86. dependency_pkgs:
  87. - python-m2crypto
  88. - python-psutil
  89. - python-yaml
  90. dependency_pkgs_pip:
  91. - PyYAML
  92. - M2Crypto
  93. - psutil
  94. Gentoo:
  95. pkgs:
  96. - app-admin/salt
  97. MacOS:
  98. pkgs:
  99. - saltstack
  100. RedHat:
  101. pkgs:
  102. - salt-minion
  103. dependency_pkgs:
  104. - m2crypto
  105. - psutils
  106. - PyYAML
  107. dependency_pkgs_pip:
  108. - PyYAML
  109. - M2Crypto
  110. - psutil
  111. {%- endload %}
  112. {%- if pillar.salt.minion is defined %}
  113. {%- set raw_minion = salt['grains.filter_by'](minion_specific, merge=salt['pillar.get']('salt:minion')) %}
  114. {%- set minion = salt['grains.filter_by'](minion_common, merge=raw_minion) %}
  115. {%- if pillar.salt.minion.proxy is defined %}
  116. {% set proxy = salt['grains.filter_by']({
  117. 'Debian': {
  118. 'napalm_pkgs': ['python-pip', 'libxml2-dev', 'libxslt1-dev', 'zlib1g-dev'],
  119. 'napalm_pip_pkgs': ['napalm', 'oauth']
  120. },
  121. 'RedHat': {
  122. 'napalm_pkgs': ['libxml2-dev', 'libxslt1-dev', 'zlib1g-dev']
  123. },
  124. }, merge=pillar.salt.minion.get('proxy', {})) %}
  125. {%- endif %}
  126. {%- endif %}
  127. {%- load_yaml as api_common %}
  128. default:
  129. pkgs:
  130. - salt-api
  131. service: salt-api
  132. {%- endload %}
  133. {%- set api = salt['grains.filter_by'](api_common, merge=salt['pillar.get']('salt:api')) %}
  134. {%- load_yaml as control_common %}
  135. default:
  136. cloud_pips:
  137. - apache-libcloud
  138. - netaddr
  139. cloud_pkgs:
  140. - python-netaddr
  141. - python-libcloud
  142. virt_pips:
  143. - libvirt-python
  144. maas_pkgs:
  145. - python-maas-client
  146. cluster: {}
  147. {%- endload %}
  148. {%- load_yaml as control_specific %}
  149. Debian:
  150. virt_pkgs:
  151. - libvirt-dev
  152. - pkg-config
  153. {% if grains.oscodename == 'trusty' %}
  154. - libguestfs-tools
  155. {% endif %}
  156. RedHat:
  157. virt_pkgs:
  158. - libvirt-dev
  159. - pkg-config
  160. {%- endload %}
  161. {%- if pillar.salt.control is defined %}
  162. {%- set raw_control = salt['grains.filter_by'](control_specific, merge=salt['pillar.get']('salt:control')) %}
  163. {%- set control = salt['grains.filter_by'](control_common, merge=raw_control) %}
  164. {%- endif %}