Merge "Use multistore modules to set up glance_store"
This commit is contained in:
commit
a169bc4e6a
@ -51,42 +51,43 @@ class openstack_integration::glance (
|
|||||||
}
|
}
|
||||||
case $backend {
|
case $backend {
|
||||||
'file': {
|
'file': {
|
||||||
include glance::backend::file
|
glance::backend::multistore::file { 'file1': }
|
||||||
$backend_store = ['file']
|
$default_backend = 'file1'
|
||||||
}
|
}
|
||||||
'rbd': {
|
'rbd': {
|
||||||
class { 'glance::backend::rbd':
|
glance::backend::multistore::rbd { 'rbd1':
|
||||||
rbd_store_user => 'openstack',
|
rbd_store_user => 'openstack',
|
||||||
rbd_store_pool => 'glance',
|
rbd_store_pool => 'glance',
|
||||||
}
|
}
|
||||||
$backend_store = ['rbd']
|
|
||||||
# make sure ceph pool exists before running Glance API
|
# make sure ceph pool exists before running Glance API
|
||||||
Exec['create-glance'] -> Service['glance-api']
|
Exec['create-glance'] -> Service['glance-api']
|
||||||
|
$default_backend = 'rbd1'
|
||||||
}
|
}
|
||||||
'swift': {
|
'swift': {
|
||||||
$backend_store = ['swift']
|
glance::backend::multistore::swift { 'swift1':
|
||||||
class { 'glance::backend::swift':
|
|
||||||
swift_store_user => 'services:glance',
|
swift_store_user => 'services:glance',
|
||||||
swift_store_key => 'a_big_secret',
|
swift_store_key => 'a_big_secret',
|
||||||
swift_store_create_container_on_put => 'True',
|
swift_store_create_container_on_put => 'True',
|
||||||
swift_store_auth_address => "${::openstack_integration::config::keystone_auth_uri}/v3",
|
swift_store_auth_address => "${::openstack_integration::config::keystone_auth_uri}/v3",
|
||||||
swift_store_auth_version => '3',
|
swift_store_auth_version => '3',
|
||||||
}
|
}
|
||||||
|
$default_backend = 'swift1'
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Unsupported backend (${backend})")
|
fail("Unsupported backend (${backend})")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$http_store = ['http']
|
|
||||||
$glance_stores = concat($http_store, $backend_store)
|
$enabled_backends = ["${default_backend}:${backend}"]
|
||||||
|
|
||||||
class { 'glance::api::logging':
|
class { 'glance::api::logging':
|
||||||
debug => true,
|
debug => true,
|
||||||
}
|
}
|
||||||
class { 'glance::api':
|
class { 'glance::api':
|
||||||
database_connection => 'mysql+pymysql://glance:glance@127.0.0.1/glance?charset=utf8',
|
database_connection => 'mysql+pymysql://glance:glance@127.0.0.1/glance?charset=utf8',
|
||||||
workers => 2,
|
workers => 2,
|
||||||
stores => $glance_stores,
|
enabled_backends => $enabled_backends,
|
||||||
default_store => $backend,
|
default_backend => $default_backend,
|
||||||
bind_host => $::openstack_integration::config::host,
|
bind_host => $::openstack_integration::config::host,
|
||||||
cert_file => $crt_file,
|
cert_file => $crt_file,
|
||||||
key_file => $key_file,
|
key_file => $key_file,
|
||||||
|
Loading…
Reference in New Issue
Block a user