1 Puppet::Type.newtype(:glance_image) do
3 This allows manifests to declare an image to be
6 glance_image { "Ubuntu 12.04 cloudimg amd64":
8 name => "Ubuntu 12.04 cloudimg amd64"
10 container_format => ovf,
11 disk_format => 'qcow2',
12 source => 'http://uec-images.ubuntu.com/releases/precise/release/ubuntu-12.04-server-cloudimg-amd64-disk1.img'
15 Known problems / limitations:
16 * All images are managed by the glance service.
17 This means that since users are unable to manage their own images via this type,
18 is_public is really of no use. You can probably hide images this way but that's all.
19 * As glance image names do not have to be unique, you must ensure that your glance
20 repository does not have any duplicate names prior to using this.
21 * Ensure this is run on the same server as the glance-api service.
27 newparam(:name, :namevar => true) do
33 desc 'The unique id of the image'
35 raise(Puppet::Error, 'This is a read only property')
39 newproperty(:location) do
40 desc "The permanent location of the image. Optional"
44 newproperty(:is_public) do
45 desc "Whether the image is public or not. Default true"
46 newvalues(/(y|Y)es/, /(n|N)o/)
57 newproperty(:container_format) do
58 desc "The format of the container"
59 newvalues(:ami, :ari, :aki, :bare, :ovf)
62 newproperty(:disk_format) do
63 desc "The format of the disk"
64 newvalues(:ami, :ari, :aki, :vhd, :vmd, :raw, :qcow2, :vdi, :iso)
68 desc "The source of the image to import from"
72 # Require the Glance service to be running
73 autorequire(:service) do