trying yet another method of getting data into templates

This commit is contained in:
Tim Flink 2015-05-06 20:32:00 +00:00
parent 633f2dade4
commit 46faba0162
2 changed files with 7 additions and 3 deletions

View file

@ -18,7 +18,11 @@
mode: 0644
- name: generate libvirt xml files for clients
template: src=client-libvirt.xml.j2 dest=/root/{{ item }}.libvirt.xml
template:
src: client-libvirt.xml.j2
dest: /root/{{ item }}.libvirt.xml
vmhostname: {{ clients[item]['hostname'] }}
vmmacaddress: {{ clients[item]['macaddress'] }}
with_items:
- "virt02"
- "virt03"

View file

@ -1,5 +1,5 @@
<domain type='kvm'>
<name>{{ clients[vmname]['hostname'] }}</name>
<name>{{ vmhostname }}</name>
<memory unit='KiB'>{{ mem_size_kb }}</memory>
<vcpu placement='static'>{{ num_cpus }}</vcpu>
<os>
@ -55,7 +55,7 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<interface type='bridge'>
<mac address='{{ clients[vmname]['macaddress'] }}'/>
<mac address='{{ vmmacaddress }}'/>
<source bridge='{{ bridge_name }}'/>
<model type='virtio'/>
<boot order='1'/>