diff options
Diffstat (limited to 'roles/vmm/templates')
-rw-r--r-- | roles/vmm/templates/vm.conf.j2 | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/roles/vmm/templates/vm.conf.j2 b/roles/vmm/templates/vm.conf.j2 index 2665c16..f9fa6f5 100644 --- a/roles/vmm/templates/vm.conf.j2 +++ b/roles/vmm/templates/vm.conf.j2 @@ -1,8 +1,22 @@ #jinja2: trim_blocks: True, lstrip_blocks: True +# vm configuration ~~ /etc/vm.conf +# managed by Ansible + +# ====================== # +# virtual network switch +# ====================== # + +switch "{{ vmm.switch.name }}" { + interface {{ vmm.switch.iface }} +} + +# ============================ # +# virtual machines declaration +# ============================ # + {% for vm in vms if hostvars[vm.name] is defined %} {% set guest = hostvars[vm.name] %} - vm "{{ guest.ansible_host }}" { {% if vm.enabled and vm.enabled is defined %} enable @@ -15,8 +29,5 @@ vm "{{ guest.ansible_host }}" { switch "{{ vmm.switch.name }}" } } -{% endfor %} -switch "{{ vmm.switch.name }}" { - interface {{ vmm.switch.interface }} -} +{% endfor %} |