summaryrefslogtreecommitdiff
path: root/global/overlay/etc/puppet/modules/sunet/manifests/cloudimage.pp
blob: 463df427e8c955032e7031f4bb6b619f0e5f9158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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': ensure => latest }
  package {'libvirt-bin': ensure => latest }
  package {'uuid-runtime': ensure => latest }

  file { "/var/lib/libvirt/cloud-init": 
     ensure => directory
  }
  file { "/var/lib/libvirt/cloud-init/${name}.sh":
     content => template("sunet/cloudimage/mk_cloud_image.erb"),
     mode    => "0755"
  } -> 
  exec { "/var/lib/libvirt/cloud-init/${name}.sh":
     refreshonly => true
  }
}