57ca8964b1
Add missing endpoints for deploying all Cinder services in IPv6 & SSL. Change-Id: I0ff6c89299a353ff5eb842522c2e94a58c0e9cdc
119 lines
4.2 KiB
Puppet
119 lines
4.2 KiB
Puppet
# Configure the Cinder service
|
|
#
|
|
# [*backend*]
|
|
# (optional) Cinder backend to use.
|
|
# Can be 'iscsi' or 'rbd'.
|
|
# Defaults to 'iscsi'.
|
|
#
|
|
class openstack_integration::cinder (
|
|
$backend = 'iscsi',
|
|
) {
|
|
|
|
include ::openstack_integration::config
|
|
include ::openstack_integration::params
|
|
|
|
rabbitmq_user { 'cinder':
|
|
admin => true,
|
|
password => 'an_even_bigger_secret',
|
|
provider => 'rabbitmqctl',
|
|
require => Class['::rabbitmq'],
|
|
}
|
|
rabbitmq_user_permissions { 'cinder@/':
|
|
configure_permission => '.*',
|
|
write_permission => '.*',
|
|
read_permission => '.*',
|
|
provider => 'rabbitmqctl',
|
|
require => Class['::rabbitmq'],
|
|
}
|
|
|
|
if $::openstack_integration::config::ssl {
|
|
openstack_integration::ssl_key { 'cinder':
|
|
notify => Service['httpd'],
|
|
require => Package['cinder'],
|
|
}
|
|
Exec['update-ca-certificates'] ~> Service['httpd']
|
|
}
|
|
class { '::cinder::db::mysql':
|
|
password => 'cinder',
|
|
}
|
|
class { '::cinder::keystone::auth':
|
|
public_url => "${::openstack_integration::config::base_url}:8776/v1/%(tenant_id)s",
|
|
internal_url => "${::openstack_integration::config::base_url}:8776/v1/%(tenant_id)s",
|
|
admin_url => "${::openstack_integration::config::base_url}:8776/v1/%(tenant_id)s",
|
|
public_url_v2 => "${::openstack_integration::config::base_url}:8776/v2/%(tenant_id)s",
|
|
internal_url_v2 => "${::openstack_integration::config::base_url}:8776/v2/%(tenant_id)s",
|
|
admin_url_v2 => "${::openstack_integration::config::base_url}:8776/v2/%(tenant_id)s",
|
|
public_url_v3 => "${::openstack_integration::config::base_url}:8776/v3/%(tenant_id)s",
|
|
internal_url_v3 => "${::openstack_integration::config::base_url}:8776/v3/%(tenant_id)s",
|
|
admin_url_v3 => "${::openstack_integration::config::base_url}:8776/v3/%(tenant_id)s",
|
|
password => 'a_big_secret',
|
|
}
|
|
class { '::cinder':
|
|
database_connection => 'mysql+pymysql://cinder:cinder@127.0.0.1/cinder?charset=utf8',
|
|
rabbit_host => $::openstack_integration::config::ip_for_url,
|
|
rabbit_port => $::openstack_integration::config::rabbit_port,
|
|
rabbit_userid => 'cinder',
|
|
rabbit_password => 'an_even_bigger_secret',
|
|
rabbit_use_ssl => $::openstack_integration::config::ssl,
|
|
verbose => true,
|
|
debug => true,
|
|
}
|
|
class { '::cinder::api':
|
|
keystone_password => 'a_big_secret',
|
|
auth_uri => $::openstack_integration::config::keystone_auth_uri,
|
|
identity_uri => $::openstack_integration::config::keystone_admin_uri,
|
|
default_volume_type => 'BACKEND_1',
|
|
public_endpoint => "${::openstack_integration::config::base_url}:8776",
|
|
service_name => 'httpd',
|
|
}
|
|
include ::apache
|
|
class { '::cinder::wsgi::apache':
|
|
bind_host => $::openstack_integration::config::ip_for_url,
|
|
ssl => $::openstack_integration::config::ssl,
|
|
ssl_key => "/etc/cinder/ssl/private/${::fqdn}.pem",
|
|
ssl_cert => $::openstack_integration::params::cert_path,
|
|
workers => 2,
|
|
}
|
|
class { '::cinder::quota': }
|
|
class { '::cinder::scheduler': }
|
|
class { '::cinder::scheduler::filter': }
|
|
class { '::cinder::volume':
|
|
volume_clear => 'none',
|
|
}
|
|
class { '::cinder::cron::db_purge': }
|
|
class { '::cinder::glance':
|
|
glance_api_servers => "${::openstack_integration::config::base_url}:9292",
|
|
}
|
|
case $backend {
|
|
'iscsi': {
|
|
class { '::cinder::setup_test_volume':
|
|
size => '15G',
|
|
}
|
|
cinder::backend::iscsi { 'BACKEND_1':
|
|
iscsi_ip_address => '127.0.0.1',
|
|
}
|
|
}
|
|
'rbd': {
|
|
cinder::backend::rbd { 'BACKEND_1':
|
|
rbd_user => 'openstack',
|
|
rbd_pool => 'cinder',
|
|
rbd_secret_uuid => '7200aea0-2ddd-4a32-aa2a-d49f66ab554c',
|
|
}
|
|
# make sure ceph pool exists before running Cinder API & Volume
|
|
Exec['create-cinder'] -> Service['httpd']
|
|
Exec['create-cinder'] -> Service['cinder-volume']
|
|
}
|
|
default: {
|
|
fail("Unsupported backend (${backend})")
|
|
}
|
|
}
|
|
class { '::cinder::backends':
|
|
enabled_backends => ['BACKEND_1'],
|
|
}
|
|
cinder_type { 'BACKEND_1':
|
|
ensure => present,
|
|
properties => ['volume_backend_name=BACKEND_1'],
|
|
}
|
|
|
|
}
|