aboutsummaryrefslogblamecommitdiffstats
path: root/roles/vmm/templates/vm.conf.j2
blob: f9fa6f53ca7472145b55860aaad9ca1c77e415f6 (plain) (tree)
1
2

                                               














                                        

                                                   

                                                     




                              
                                                                                
                   
                                              

         
 
            
#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
	{% else %}
	disable
	{% endif %}
	memory {{ vm.memory }}
	disk "{{ vmm.disk_dir }}/{{ guest.ansible_host }}.{{ vmm.disk_format }}"
	interface {
		switch "{{ vmm.switch.name }}"
	}
}

{% endfor %}
remember that computers suck.