blob: ed20468f142eee1529361d91703f7480a6912d93 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#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.enable is defined and vm.enable %}
enable
{% else %}
disable
{% endif %}
memory {{ vm.memory }}
disk "{{ vmm.disk_dir }}/{{ guest.ansible_host }}.{{ vmm.disk_format }}"
interface {
switch "{{ vmm.switch.name }}"
}
}
{% endfor %}
|