
The config files for glance have changed quite a bit between the Diablo and Essex releases of OpenStack. This commit refactors the config files.
114 lines
3.2 KiB
Puppet
114 lines
3.2 KiB
Puppet
# = 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',
|
|
$default_store = 'file',
|
|
$bind_host = '0.0.0.0',
|
|
$bind_port = '9292',
|
|
$registry_host = '0.0.0.0',
|
|
$registry_port = '9191',
|
|
$log_file = '/var/log/glance/api.log',
|
|
$filesystem_store_datadir = '/var/lib/glance/images/',
|
|
$swift_store_auth_address = '127.0.0.1:8080/v1.0/',
|
|
$swift_store_user = 'jdoe',
|
|
$swift_store_key = 'a86850deb2742ec3cb41518e26aa2d89',
|
|
$swift_store_container = 'glance',
|
|
$swift_store_create_container_on_put = 'False',
|
|
$auth_type = 'keystone',
|
|
$service_protocol = 'http',
|
|
$service_host = '127.0.0.1',
|
|
$service_port = '5000',
|
|
$auth_host = '127.0.0.1',
|
|
$auth_port = '35357',
|
|
$auth_protocol = 'http',
|
|
$auth_uri = "http://127.0.0.1:5000/",
|
|
$admin_token = '999888777666',
|
|
# TODO - I should update this to use a glance specific keystone user
|
|
$keystone_tenant = 'admin',
|
|
$keystone_user = 'admin',
|
|
$keystone_password = 'ChangeMe'
|
|
) inherits glance {
|
|
|
|
# TODO I need to work with Chris to ensure that I understand
|
|
# his auth requirements
|
|
if($auth_type == 'keystone') {
|
|
$context_type = 'context'
|
|
} else {
|
|
$context_type = 'auth-context'
|
|
}
|
|
|
|
File {
|
|
ensure => present,
|
|
owner => 'glance',
|
|
group => 'root',
|
|
mode => '0640',
|
|
notify => Service['glance-api'],
|
|
require => Class['glance'],
|
|
}
|
|
|
|
file { '/etc/glance/glance-api.conf':
|
|
content => template('glance/glance-api.conf.erb'),
|
|
}
|
|
|
|
file { '/etc/glance/glance-api-paste.ini':
|
|
content => template('glance/glance-api-paste.ini.erb'),
|
|
}
|
|
|
|
file { '/etc/glance/glance-cache.conf':
|
|
content => template('glance/glance-cache.conf.erb'),
|
|
}
|
|
|
|
service { 'glance-api':
|
|
name => $::glance::params::api_service_name,
|
|
ensure => running,
|
|
enable => true,
|
|
hasstatus => true,
|
|
hasrestart => true,
|
|
subscribe => File['/etc/glance/glance-api.conf'],
|
|
require => Class['glance']
|
|
}
|
|
}
|