diff options
author | Leif Johansson <leifj@sunet.se> | 2015-05-09 16:12:34 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2015-05-09 16:12:34 +0200 |
commit | 81c7f88b9655c1c0bfb9de6fa8efaa3e1698b3cb (patch) | |
tree | 94c7421419c729030b8ec8b36ae77e60b8711efd /global/overlay/etc/puppet | |
parent | 3b0987256c1f81ef4a5be7d83de564363ca57b28 (diff) |
consolidatesunet-ops-2015-05-09-v03
Diffstat (limited to 'global/overlay/etc/puppet')
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp | 10 | ||||
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp b/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp index d4501a4..a232b61 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp @@ -27,14 +27,12 @@ define sunet::cloudimage ( exec {"wget -O${image_src} ${image_url}": onlyif => "test ! -f ${image_src}" } - file { "/var/lib/libvirt/cloud-init": - ensure => directory - } - file { "/var/lib/libvirt/cloud-init/${name}.sh": + file { "/var/lib/libvirt/images": ensure => directory } -> + file { "/var/lib/libvirt/images/${name}/${name}-init.sh": content => template("sunet/cloudimage/mk_cloud_image.erb"), mode => "0755" } -> - exec { "/var/lib/libvirt/cloud-init/${name}.sh": - refreshonly => true + exec { "/var/lib/libvirt/images/${name}-init.sh": + onlyif => "test ! -f /var/lib/libvirt/images/${name}/${name}.img" } } diff --git a/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb b/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb index 7b5b052..2f76078 100644 --- a/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb +++ b/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb @@ -1,5 +1,7 @@ #!/bin/bash +# do not edit by hand + src_image="<%= @image_src %>" size="<%= @size %>" dhcp="<%= @dhcp ? 'yes' : 'no' %>" @@ -22,8 +24,8 @@ cd "/var/lib/libvirt/cloud-init" id=$(uuidgen) -seed=${id}_seed.img -disk=${id}.img +seed=${hostname}_seed.img +disk=${hostname}.img rm -f ${seed} truncate --size 2M ${seed} |