aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/templates/vm.conf.j2
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-04 21:18:39 +0100
committerbinary <me@rgoncalves.se>2020-11-04 21:18:39 +0100
commit282be811d2ac07a76d56ac066df5bf33d748bd64 (patch)
treeb7287f79b77604ab1c14600da2a63f39ec51a798 /roles/vmm/templates/vm.conf.j2
parentaa47761cf59f2f8944e961227053a98bb57c25fe (diff)
downloadinfrastructure-282be811d2ac07a76d56ac066df5bf33d748bd64.tar.gz
Init basic action for vmm hypervisor
Diffstat (limited to 'roles/vmm/templates/vm.conf.j2')
-rw-r--r--roles/vmm/templates/vm.conf.j222
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 }}
+}
remember that computers suck.