diff options
| author | binary <me@rgoncalves.se> | 2020-11-08 20:56:18 +0100 | 
|---|---|---|
| committer | binary <me@rgoncalves.se> | 2020-11-08 20:56:18 +0100 | 
| commit | e15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf (patch) | |
| tree | ef0130c97f594ca7d57676c9e1d027724211fba8 /roles/vmm/templates/vm.conf.j2 | |
| parent | 605d9efb0ad2734278d8bdb5f9e0862d8e0a1a7e (diff) | |
| download | infrastructure-e15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf.tar.gz | |
Add working script for ssh init on alpine vm
Diffstat (limited to 'roles/vmm/templates/vm.conf.j2')
| -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 %} |