From 282be811d2ac07a76d56ac066df5bf33d748bd64 Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 4 Nov 2020 21:18:39 +0100 Subject: Init basic action for vmm hypervisor --- roles/vmm/templates/vm.conf.j2 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 roles/vmm/templates/vm.conf.j2 (limited to 'roles/vmm/templates') diff --git a/roles/vmm/templates/vm.conf.j2 b/roles/vmm/templates/vm.conf.j2 new file mode 100644 index 0000000..88be7fb --- /dev/null +++ b/roles/vmm/templates/vm.conf.j2 @@ -0,0 +1,22 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True + +{% for vm in vm.hosts %} +{% set vm = hostvars[vm] %} + +vm "{{ vm.ansible_host }}" { + {% if vm.enabled %} + enable + {% else %} + disable + {% endif %} + memory {{ vm.memory }} + disk "{{ vmm.disk.dir }}/{{ vm.ansible_host }}.{{ vmm.disk.format }}" + interface { + switch "{{ vmm.config.switch.name }}" + } +} +{% endfor %} + +switch "{{ vmm.config.switch.name }}" { + interface {{ vmm.config.switch.interface }} +} -- cgit v1.2.3