define sunet::cloudimage ( $src_image = undef, $dhcp = true, $size = "1G", $bridge = "br0", $memory = "1024", $cpus = "1", $resolver = undef, $ip = undef, $netmask = undef, $gateway = undef, $ip6 = undef, $netmask6 = "64", $gateway6 = undef, $tag = undef, $repo = undef ) { package {'mtools': require => latest } package {'libvirt-bin': require => latest } package {'uuid-runtime': require => latest } file { "/var/lib/libvirt/cloud-init": ensure => directory } file { "/var/lib/libvirt/cloud-init/${name}.sh": content => template("cloudimage/mk_cloud_image.erb") } -> exec { "/var/lib/libvirt/cloud-init/${name}.sh": refreshonly => true } }