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.

8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {% from "salt/map.jinja" import control with context %}
  2. {%- if control.enabled and control.virt_enabled is defined %}
  3. include:
  4. - salt.minion
  5. salt_control_virt_packages:
  6. pkg.installed:
  7. - names: {{ control.virt_pkgs }}
  8. update-guestfs-appliance:
  9. cmd.wait:
  10. - watch:
  11. - pkg: salt_control_virt_packages
  12. {#
  13. {%- for package in control.virt_pips %}
  14. {{ package }}:
  15. pip.installed:
  16. - require:
  17. - pkg: salt_control_virt_packages
  18. {%- endfor %}
  19. #}
  20. /etc/salt/minion.d/_virt.conf:
  21. file.managed:
  22. - source: salt://salt/files/_virt.conf
  23. - user: root
  24. - group: root
  25. - template: jinja
  26. - require:
  27. - pkg: salt_control_virt_packages
  28. {%- if not grains.get('noservices', False) %}
  29. - watch_in:
  30. - service: salt_minion_service
  31. {%- endif %}
  32. {%- for cluster_name, cluster in control.cluster.iteritems() %}
  33. {%- if cluster.engine == "virt" %}
  34. {%- for node_name, node in cluster.node.iteritems() %}
  35. {%- if node.provider == grains.id %}
  36. {%- set size = control.size.get(node.size) %}
  37. salt_control_virt_{{ cluster_name }}_{{ node_name }}:
  38. module.run:
  39. - name: virtng.init
  40. - m_name: {{ node_name }}.{{ cluster.domain }}
  41. - cpu: {{ size.cpu }}
  42. - mem: {{ size.ram }}
  43. - image: {{ node.image }}
  44. - start: True
  45. - disk: {{ size.disk_profile }}
  46. - nic: {{ size.net_profile }}
  47. - kwargs:
  48. seed: True
  49. serial_type: pty
  50. console: True
  51. - unless: virsh list --all | grep {{ node_name }}.{{ cluster.domain }}
  52. #salt_control_seed_{{ cluster_name }}_{{ node_name }}:
  53. # module.run:
  54. # - name: seed.apply
  55. # - path: /srv/salt-images/{{ node_name }}.{{ cluster.domain }}/system.qcow2
  56. # - id_: {{ node_name }}.{{ cluster.domain }}
  57. # - unless: virsh list | grep {{ node_name }}.{{ cluster.domain }}
  58. {%- endif %}
  59. {%- endfor %}
  60. {%- endif %}
  61. {%- endfor %}
  62. {%- endif %}