From e15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf Mon Sep 17 00:00:00 2001 From: binary Date: Sun, 8 Nov 2020 20:56:18 +0100 Subject: Add working script for ssh init on alpine vm --- roles/vmm/templates/vm.conf.j2 | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'roles/vmm/templates') 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 %} -- cgit v1.2.3