Parcourir la source

Virtng module

tags/0.4
Ales Komarek il y a 8 ans
Parent
révision
05e3c33bdf
3 fichiers modifiés avec 10 ajouts et 4 suppressions
  1. +0
    -0
      _modules/virtng.py
  2. +1
    -1
      salt/control/virt.sls
  3. +9
    -3
      salt/files/_virt.conf

_modules/virt_ng.py → _modules/virtng.py Voir le fichier


+ 1
- 1
salt/control/virt.sls Voir le fichier



salt_control_virt_{{ cluster_name }}_{{ node_name }}: salt_control_virt_{{ cluster_name }}_{{ node_name }}:
module.run: module.run:
- name: virt.init
- name: virtng.init
- m_name: {{ node_name }}.{{ cluster.domain }} - m_name: {{ node_name }}.{{ cluster.domain }}
- cpu: {{ size.cpu }} - cpu: {{ size.cpu }}
- mem: {{ size.ram }} - mem: {{ size.ram }}

+ 9
- 3
salt/files/_virt.conf Voir le fichier

{% from "salt/map.jinja" import control with context %} {% from "salt/map.jinja" import control with context %}


{%- if control.net_profile is defined or control.disk_profile is defined %}
virt: virt:
{%- if control.net_profile is defined %}
nic: nic:
{%- for item_name, item in control.get('net_profile', {}).iteritems() %}
{%- for item_name, item in control.net_profile.iteritems() %}
{{ item_name }}: {{ item_name }}:
{%- for iface_name, iface in item.iteritems() %} {%- for iface_name, iface in item.iteritems() %}
{{ iface_name }}: {{ iface_name }}:
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
{%- endif %}
{%- if control.disk_profile is defined %}
disk: disk:
{%- for item_name, item in control.get('disk_profile', {}).iteritems() %}
{%- for item_name, item in control.disk_profile.iteritems() %}
{{ item_name }}: {{ item_name }}:
{%- for disk_name, disk in item.iteritems() %} {%- for disk_name, disk in item.iteritems() %}
- {{ disk }}: - {{ disk }}:
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
{%- endif %}
{%- endif %}


virt.images: /var/lib/libvirt/images
virt.images: /var/lib/libvirt/images

Chargement…
Annuler
Enregistrer