summaryrefslogtreecommitdiffstats
path: root/playbooks/libvirt/templates
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-04-10 11:33:25 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-04-10 11:33:25 -0400
commitdd0f997a77fa88291bbd0ec3d59ba0ad369d9fec (patch)
tree5c5aad99026f1b1d289d0b5597fb5f596b4906c7 /playbooks/libvirt/templates
parent914b4c41d4a5f25f9ea850d21a50926148ae4bf1 (diff)
parent9fbec064d28a72963b1566258b4bcabcd63b2c23 (diff)
downloadopenshift-dd0f997a77fa88291bbd0ec3d59ba0ad369d9fec.tar.gz
openshift-dd0f997a77fa88291bbd0ec3d59ba0ad369d9fec.tar.bz2
openshift-dd0f997a77fa88291bbd0ec3d59ba0ad369d9fec.tar.xz
openshift-dd0f997a77fa88291bbd0ec3d59ba0ad369d9fec.zip
Merge pull request #141 from lhuard1A/virt
Add libvirt as a provider for openshift-ansible
Diffstat (limited to 'playbooks/libvirt/templates')
-rw-r--r--playbooks/libvirt/templates/domain.xml62
-rw-r--r--playbooks/libvirt/templates/meta-data2
-rw-r--r--playbooks/libvirt/templates/user-data10
3 files changed, 74 insertions, 0 deletions
diff --git a/playbooks/libvirt/templates/domain.xml b/playbooks/libvirt/templates/domain.xml
new file mode 100644
index 000000000..da037d138
--- /dev/null
+++ b/playbooks/libvirt/templates/domain.xml
@@ -0,0 +1,62 @@
+<domain type='kvm' id='8'>
+ <name>{{ item }}</name>
+ <memory unit='GiB'>1</memory>
+ <currentMemory unit='GiB'>1</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'>
+ <timer name='rtc' tickpolicy='catchup'/>
+ <timer name='pit' tickpolicy='delay'/>
+ <timer name='hpet' present='no'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source file='{{ libvirt_storage_pool_path }}/{{ item }}.qcow2'/>
+ <target dev='vda' bus='virtio'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source file='{{ libvirt_storage_pool_path }}/{{ item }}_cloud-init.iso'/>
+ <target dev='vdb' bus='virtio'/>
+ <readonly/>
+ </disk>
+ <controller type='usb' index='0' />
+ <interface type='network'>
+ <source network='default'/>
+ <model type='virtio'/>
+ </interface>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <channel type='spicevmc'>
+ <target type='virtio' name='com.redhat.spice.0'/>
+ </channel>
+ <input type='tablet' bus='usb' />
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='spice' autoport='yes' />
+ <video>
+ <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
+ </video>
+ <redirdev bus='usb' type='spicevmc'>
+ </redirdev>
+ <memballoon model='virtio'>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/playbooks/libvirt/templates/meta-data b/playbooks/libvirt/templates/meta-data
new file mode 100644
index 000000000..5d779519f
--- /dev/null
+++ b/playbooks/libvirt/templates/meta-data
@@ -0,0 +1,2 @@
+instance-id: {{ item[0] }}
+local-hostname: {{ item[0] }}
diff --git a/playbooks/libvirt/templates/user-data b/playbooks/libvirt/templates/user-data
new file mode 100644
index 000000000..985badc8e
--- /dev/null
+++ b/playbooks/libvirt/templates/user-data
@@ -0,0 +1,10 @@
+#cloud-config
+
+disable_root: 0
+
+system_info:
+ default_user:
+ name: root
+
+ssh_authorized_keys:
+ - {{ lookup('file', '~/.ssh/id_rsa.pub') }}