diff --git a/README.markdown b/README.markdown new file mode 100644 index 00000000..d17c1722 --- /dev/null +++ b/README.markdown @@ -0,0 +1,31 @@ +# PuppetLabs Glance module # + +This module provides a set of manifests that can be +used to install and configure glance. + +It is currently targettting the essex release of OpenStack. + +For Daiblo support, use the Diablo branch. + +# Platforms # + + Ubuntu 11.04 (Natty) + Ubuntu 11.10 (Oneiric) + +# Quick Start # + + The below examples shows how the classes from this module can be + declared in site.pp to install both the glance registry and api services on + a node identified as glance. + + In the below example, the default port for the registy service has been + overridden from its default value of 9191. + + node glance { + class { 'glance::registry': + bind_port => '9393', + } + class { 'glance::api': + registry_port = '9393', + } + } diff --git a/manifests/api.pp b/manifests/api.pp index cb90d815..9adc5feb 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -1,6 +1,50 @@ +# = Class: glance::api +# +# This class installs and configures the glance api server. +# +# == Paremeters: +# +# $log_verbose - rather to log the glance api service at verbose level. +# Optional. Default: false +# +# $log_debug - rather to log the glance api service at debug level. +# Optional. Default: false +# +# $default_store - Backend used to store glance dist images. +# Optional. Default: file +# +# $bind_host - The address of the host to bind to. +# Optional. Default: 0.0.0.0 +# +# $bind_port - The port the server should bind to. +# Optional. Default: 9292 +# +# $registry_host - The address used to connecto to the registy service. +# Optional. Default: +# +# $registry_port - The port of the Glance registry service. +# Optional. Default: 9191 +# +# $log_file - The path of file used for logging +# Optional. Default: /var/log/glance/api.log +# +# $filesystem_store_datadir - Location where dist images are stored when +# default_store == file. +# Optional. Default: /var/lib/glance/images/ +# +# $swift_store_auth_address - Optional. Default: '127.0.0.1:8080/v1.0/', +# +# $swift_store_user - Optional. Default:'jdoe', +# +# $swift_store_key - Optional. Default: 'a86850deb2742ec3cb41518e26aa2d89', +# +# $swift_store_container - 'glance', +# +# $swift_store_create_container_on_put - 'False' +# class glance::api( - $log_verbose = 'false', - $log_debug = 'false', + $log_verbose = false, + $log_debug = false, $default_store = 'file', $bind_host = '0.0.0.0', $bind_port = '9292', @@ -15,21 +59,21 @@ class glance::api( $swift_store_create_container_on_put = 'False' ) inherits glance { - file { "/etc/glance/glance-api.conf": + file { '/etc/glance/glance-api.conf': ensure => present, owner => 'glance', group => 'root', - mode => 640, + mode => '0640', content => template('glance/glance-api.conf.erb'), - require => Class["glance"] + require => Class['glance'] } - service { "glance-api": + service { 'glance-api': ensure => running, enable => true, hasstatus => true, hasrestart => true, - subscribe => File["/etc/glance/glance-api.conf"], - require => Class["glance"] + subscribe => File['/etc/glance/glance-api.conf'], + require => Class['glance'] } } diff --git a/manifests/init.pp b/manifests/init.pp index 75d6c161..98d170e8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,7 +5,7 @@ class glance( ensure => directory, owner => 'glance', group => 'root', - mode => 770, + mode => '0770', require => Package['glance'] } package { 'glance': ensure => $package_ensure } diff --git a/manifests/registry.pp b/manifests/registry.pp index 4cd62916..47f8e3c7 100644 --- a/manifests/registry.pp +++ b/manifests/registry.pp @@ -1,27 +1,27 @@ class glance::registry( - $log_verbose = 'false', - $log_debug = 'false', + $log_verbose = false, + $log_debug = false, $bind_host = '0.0.0.0', $bind_port = '9191', $log_file = '/var/log/glance/registry.log', $sql_connection = 'sqlite:///var/lib/glance/glance.sqlite', $sql_idle_timeout = '3600' ) inherits glance { - file { "/etc/glance/glance-registry.conf": + file { '/etc/glance/glance-registry.conf': ensure => present, owner => 'glance', group => 'root', - mode => 640, + mode => '0640', content => template('glance/glance-registry.conf.erb'), - require => Class["glance"] + require => Class['glance'] } - service { "glance-registry": + service { 'glance-registry': ensure => running, enable => true, hasstatus => true, hasrestart => true, - subscribe => File["/etc/glance/glance-registry.conf"], - require => Class["glance"] + subscribe => File['/etc/glance/glance-registry.conf'], + require => Class['glance'] } } diff --git a/spec/classes/glance_spec.rb b/spec/classes/glance_spec.rb index 07f480fc..373d9145 100644 --- a/spec/classes/glance_spec.rb +++ b/spec/classes/glance_spec.rb @@ -23,7 +23,7 @@ describe 'glance' do it { should contain_file('/etc/glance/').with( 'ensure' => 'directory', 'owner' => 'glance', - 'mode' => '770', + 'mode' => '0770', 'require' => 'Package[glance]' )} end diff --git a/templates/glance-api.conf.erb b/templates/glance-api.conf.erb index a656cae2..22cd5acd 100644 --- a/templates/glance-api.conf.erb +++ b/templates/glance-api.conf.erb @@ -67,4 +67,4 @@ paste.app_factory = glance.api.v1:app_factory paste.filter_factory = glance.api.middleware.version_negotiation:filter_factory [filter:context] -paste.filter_factory = glance.common.context:filter_factory \ No newline at end of file +paste.filter_factory = glance.common.context:filter_factory