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.

40 lines
824B

  1. {% from "salt/map.jinja" import control with context %}
  2. {%- if control.enabled and control.virt_enabled is defined %}
  3. salt_control_virt_packages:
  4. pkg.installed:
  5. - names: {{ control.virt_pkgs }}
  6. {%- for package in control.virt_pips %}
  7. {{ package }}:
  8. pip.installed:
  9. - require:
  10. - pkg: salt_control_virt_packages
  11. {%- endfor %}
  12. {%- for cluster_name, cluster in control.cluster.iteritems() %}
  13. {%- if cluster.engine == "virt" %}
  14. {%- for node_name, node in cluster.node.iteritems() %}
  15. {%- set size = control.size.get(node.size) %}
  16. salt_control_virt_{{ cluster_name }}_{{ node_name }}:
  17. module.run:
  18. - name: virt.init
  19. - m_name: {{ node_name }}_{{ cluster.domain }}
  20. - cpu: {{ size.cpu }}
  21. - mem: {{ size.ram }}
  22. - image: salt://{{ node.image }}
  23. {%- endfor %}
  24. {%- endif %}
  25. {%- endfor %}
  26. {%- endif %}