commit
9b0c1c3757
|
@ -50,6 +50,7 @@ class glance::api(
|
|||
$keystone_password = 'ChangeMe'
|
||||
) inherits glance {
|
||||
|
||||
# used to configure concat
|
||||
include 'concat::setup'
|
||||
|
||||
# TODO I need to work with Chris to ensure that I understand
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#
|
||||
# used to model the line in the file
|
||||
# that configures which storage backend
|
||||
# to use
|
||||
#
|
||||
class glance::backend(
|
||||
$default_store
|
||||
) {
|
||||
glance::api::config { 'backend':
|
||||
config => {
|
||||
'default_store' => $default_store
|
||||
},
|
||||
order => '02',
|
||||
}
|
||||
}
|
|
@ -8,9 +8,15 @@ class glance::backend::file(
|
|||
$filesystem_store_datadir = '/var/lib/glance/images/'
|
||||
) inherits glance::api {
|
||||
|
||||
# set file as default store
|
||||
class { 'glance::backend':
|
||||
default_store => 'file',
|
||||
#
|
||||
# modeled as its own config define so that any attempts to
|
||||
# define multiple backends will fail
|
||||
#
|
||||
glance::api::config { 'backend':
|
||||
config => {
|
||||
'default_store' => 'file',
|
||||
},
|
||||
order => '04',
|
||||
}
|
||||
|
||||
# configure directory where files should be stored
|
||||
|
|
|
@ -19,9 +19,15 @@ class glance::backend::swift(
|
|||
$swift_store_create_container_on_put = 'False',
|
||||
) inherits glance::api {
|
||||
|
||||
# specify swift as backend
|
||||
class { 'glance::backend':
|
||||
default_store => 'swift',
|
||||
#
|
||||
# modeled as its own config define so that any attempts to
|
||||
# define multiple backends will fail
|
||||
#
|
||||
glance::api::config { 'backend':
|
||||
config => {
|
||||
'default_store' => 'swift',
|
||||
},
|
||||
order => '04',
|
||||
}
|
||||
|
||||
glance::api::config { 'swift':
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
class glance::notify(
|
||||
$notifier_strategy
|
||||
) {
|
||||
|
||||
glance::api::config { 'notify':
|
||||
config => {
|
||||
'notifier_strategy' => $notifier_strategy,
|
||||
|
|
|
@ -56,7 +56,7 @@ describe 'glance::api' do
|
|||
it 'should compile the template based on the class parameters' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/01_header',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/01_glance-api-header',
|
||||
[
|
||||
"verbose = #{param_hash[:log_verbose]}",
|
||||
"debug = #{param_hash[:log_debug]}",
|
||||
|
@ -72,7 +72,7 @@ describe 'glance::api' do
|
|||
expected_lines = ['[paste_deploy]', 'flavor = keystone'] if params[:auth_type] = 'keystone'
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/99_footer',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/99_glance-api-footer',
|
||||
expected_lines
|
||||
)
|
||||
|
||||
|
|
|
@ -9,14 +9,14 @@ describe 'glance::backend::file' do
|
|||
it 'should set the default store to file' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/02_backend',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/04_glance-api-backend',
|
||||
['default_store = file']
|
||||
)
|
||||
end
|
||||
it 'should configure file backend settings' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_file',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-file',
|
||||
['filesystem_store_datadir = /var/lib/glance/images/']
|
||||
)
|
||||
end
|
||||
|
@ -30,7 +30,7 @@ describe 'glance::backend::file' do
|
|||
it 'should configure file backend settings with specified parameter' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_file',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-file',
|
||||
['filesystem_store_datadir = /var/lib/glance/images2']
|
||||
)
|
||||
end
|
||||
|
|
|
@ -15,14 +15,14 @@ describe 'glance::backend::swift' do
|
|||
it 'should set the default store to file' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/02_backend',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/04_glance-api-backend',
|
||||
['default_store = swift']
|
||||
)
|
||||
end
|
||||
it 'should configure swift settings with defaults' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_swift',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-swift',
|
||||
[
|
||||
'swift_store_auth_address = 127.0.0.1:8080/v1.0/',
|
||||
'swift_store_user = glance',
|
||||
|
@ -46,7 +46,7 @@ describe 'glance::backend::swift' do
|
|||
it 'should configure file backend settings with specified parameter' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_swift',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-swift',
|
||||
[
|
||||
'swift_store_auth_address = 127.0.0.1:8080/v2.0/',
|
||||
'swift_store_user = glance',
|
||||
|
|
|
@ -9,14 +9,14 @@ describe 'glance::notify::qpid' do
|
|||
it 'should set nofier strategy to qpid' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/06_notify',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/06_glance-api-notify',
|
||||
['notifier_strategy = qpid']
|
||||
)
|
||||
end
|
||||
it 'should use the current qpid template' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/07_qpid',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/07_glance-api-qpid',
|
||||
['#qpid_port = 5672']
|
||||
)
|
||||
end
|
||||
|
|
|
@ -9,14 +9,14 @@ describe 'glance::notify::rabbitmq' do
|
|||
it 'should set nofier strategy to rabbit' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/06_notify',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/06_glance-api-notify',
|
||||
['notifier_strategy = rabbit']
|
||||
)
|
||||
end
|
||||
it 'should use the current rabbitmq template' do
|
||||
verify_contents(
|
||||
subject,
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/07_rabbitmq',
|
||||
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/07_glance-api-rabbitmq',
|
||||
['#rabbit_port = 5672']
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue