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.

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