diff options
author | Leif Johansson <leifj@sunet.se> | 2015-05-08 16:32:24 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2015-05-08 16:32:24 +0200 |
commit | 3ae2c130873f1a39c9862368ada5070cb3798e49 (patch) | |
tree | e869fdad8561e1ee269098b7893b16b908654982 /global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp | |
parent | 6a0cc5d45cfaf45d158925586484a2c541a3ef9e (diff) |
dl imagesunet-ops-2015-05-08-v08
Diffstat (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp')
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp b/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp index a8a3bfe..feca24b 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp @@ -1,5 +1,5 @@ define sunet::cloudimage ( - $src_image = undef, + $image_url = 'https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img', $dhcp = true, $size = "1G", $bridge = "br0", @@ -20,6 +20,11 @@ define sunet::cloudimage ( package {'libvirt-bin': ensure => latest } package {'uuid-runtime': ensure => latest } + $image_url_a = split($image_url,"/") + $image_src = "/var/lib/libvirt/images/$image_url_a[-1]" + exec {"wget -O${image_src} ${image_url}": + onlyif => "test ! -f ${image_src}" + } file { "/var/lib/libvirt/cloud-init": ensure => directory } |