diff options
author | binary <me@rgoncalves.se> | 2020-11-04 21:18:39 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2020-11-04 21:18:39 +0100 |
commit | 282be811d2ac07a76d56ac066df5bf33d748bd64 (patch) | |
tree | b7287f79b77604ab1c14600da2a63f39ec51a798 /roles/vmm/templates | |
parent | aa47761cf59f2f8944e961227053a98bb57c25fe (diff) | |
download | infrastructure-282be811d2ac07a76d56ac066df5bf33d748bd64.tar.gz |
Init basic action for vmm hypervisor
Diffstat (limited to 'roles/vmm/templates')
-rw-r--r-- | roles/vmm/templates/vm.conf.j2 | 22 |
1 files changed, 22 insertions, 0 deletions
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 }} +} |