Add cinder support
remove volume management from openstack::compute add cinder server services to openstack::controller add cinder db code
This commit is contained in:
25
manifests/cinder.pp
Normal file
25
manifests/cinder.pp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
class openstack::cinder(
|
||||||
|
$sql_connection,
|
||||||
|
$rabbit_password,
|
||||||
|
$rabbit_host = '127.0.0.1',
|
||||||
|
$volume_group = 'nova-volumes',
|
||||||
|
$enabled = true
|
||||||
|
) {
|
||||||
|
|
||||||
|
class { 'cinder::base':
|
||||||
|
rabbit_password => $rabbit_password,
|
||||||
|
rabbit_host => $rabbit_host,
|
||||||
|
sql_connection => $sql_connection,
|
||||||
|
verbose => $verbose,
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install / configure nova-volume
|
||||||
|
class { 'cinder::volume':
|
||||||
|
enabled => $enabled,
|
||||||
|
}
|
||||||
|
if $enabled {
|
||||||
|
class { 'cinder::volume::iscsi':
|
||||||
|
volume_group => $volume_group,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# == Class: openstack::compute
|
# == Class: openstack::compute
|
||||||
#
|
#
|
||||||
# Manifest to install/configure nova-compute and nova-volume
|
# Manifest to install/configure nova-compute
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
@@ -41,11 +41,6 @@ class openstack::compute (
|
|||||||
$glance_api_servers = false,
|
$glance_api_servers = false,
|
||||||
# Virtualization
|
# Virtualization
|
||||||
$libvirt_type = 'kvm',
|
$libvirt_type = 'kvm',
|
||||||
# Volumes
|
|
||||||
$nova_volume = 'nova-volumes',
|
|
||||||
$manage_volumes = true,
|
|
||||||
# TODO - not sure if using a variable as a default really works
|
|
||||||
$iscsi_ip_address = $internal_address,
|
|
||||||
# VNC
|
# VNC
|
||||||
$vnc_enabled = true,
|
$vnc_enabled = true,
|
||||||
$vncproxy_host = undef,
|
$vncproxy_host = undef,
|
||||||
@@ -111,6 +106,7 @@ class openstack::compute (
|
|||||||
admin_tenant_name => 'services',
|
admin_tenant_name => 'services',
|
||||||
admin_user => 'nova',
|
admin_user => 'nova',
|
||||||
admin_password => $nova_user_password,
|
admin_password => $nova_user_password,
|
||||||
|
# TODO override enabled_apis
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$enable_network_service = false
|
$enable_network_service = false
|
||||||
@@ -132,17 +128,4 @@ class openstack::compute (
|
|||||||
install_service => $enable_network_service,
|
install_service => $enable_network_service,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $manage_volumes {
|
|
||||||
# Install / configure nova-volume
|
|
||||||
class { 'nova::volume':
|
|
||||||
enabled => $enabled,
|
|
||||||
}
|
|
||||||
if $enabled {
|
|
||||||
class { 'nova::volume::iscsi':
|
|
||||||
volume_group => $nova_volume,
|
|
||||||
iscsi_ip_address => $iscsi_ip_address,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
# Defaults to false.
|
# Defaults to false.
|
||||||
# [network_config] Hash that can be used to pass implementation specifc
|
# [network_config] Hash that can be used to pass implementation specifc
|
||||||
# network settings. Optioal. Defaults to {}
|
# network settings. Optioal. Defaults to {}
|
||||||
# [verbose] Rahter to log services at verbose.
|
# [verbose] Whether to log services at verbose.
|
||||||
# [export_resources] Rather to export resources.
|
# [export_resources] Rather to export resources.
|
||||||
# Horizon related config - assumes puppetlabs-horizon code
|
# Horizon related config - assumes puppetlabs-horizon code
|
||||||
# [secret_key] secret key to encode cookies, …
|
# [secret_key] secret key to encode cookies, …
|
||||||
@@ -121,8 +121,13 @@ class openstack::controller (
|
|||||||
$quantum = false,
|
$quantum = false,
|
||||||
$horizon_app_links = undef,
|
$horizon_app_links = undef,
|
||||||
# General
|
# General
|
||||||
$verbose = false,
|
$verbose = 'False',
|
||||||
$export_resources = true,
|
$export_resources = true,
|
||||||
|
# if the cinder management components should be installed
|
||||||
|
$cinder_user_password = 'cinder_user_pass',
|
||||||
|
$cinder_db_password = 'cinder_db_pass',
|
||||||
|
$cinder_db_user = 'cinder',
|
||||||
|
$cinder_db_dbname = 'cinder',
|
||||||
$enabled = true
|
$enabled = true
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -150,6 +155,9 @@ class openstack::controller (
|
|||||||
nova_db_user => $nova_db_user,
|
nova_db_user => $nova_db_user,
|
||||||
nova_db_password => $nova_db_password,
|
nova_db_password => $nova_db_password,
|
||||||
nova_db_dbname => $nova_db_dbname,
|
nova_db_dbname => $nova_db_dbname,
|
||||||
|
cinder_db_user => $cinder_db_user,
|
||||||
|
cinder_db_password => $cinder_db_password,
|
||||||
|
cinder_db_dbname => $cinder_db_dbname,
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
enabled => $enabled,
|
enabled => $enabled,
|
||||||
}
|
}
|
||||||
@@ -172,6 +180,7 @@ class openstack::controller (
|
|||||||
admin_address => $admin_address,
|
admin_address => $admin_address,
|
||||||
glance_user_password => $glance_user_password,
|
glance_user_password => $glance_user_password,
|
||||||
nova_user_password => $nova_user_password,
|
nova_user_password => $nova_user_password,
|
||||||
|
cinder_user_password => $cinder_user_password,
|
||||||
enabled => $enabled,
|
enabled => $enabled,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,6 +241,19 @@ class openstack::controller (
|
|||||||
exported_resources => $export_resources,
|
exported_resources => $export_resources,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
######### Cinder Controller Services ########
|
||||||
|
class { "cinder::base":
|
||||||
|
verbose => $verbose,
|
||||||
|
sql_connection => "mysql://${cinder_db_user}:${cinder_db_password}@${db_host}/${cinder_db_dbname}?charset=utf8",
|
||||||
|
rabbit_password => $rabbit_password,
|
||||||
|
}
|
||||||
|
|
||||||
|
class { 'cinder::api':
|
||||||
|
keystone_password => $cinder_user_password,
|
||||||
|
}
|
||||||
|
|
||||||
|
class { 'cinder::scheduler': }
|
||||||
|
|
||||||
######## Horizon ########
|
######## Horizon ########
|
||||||
class { 'openstack::horizon':
|
class { 'openstack::horizon':
|
||||||
secret_key => $secret_key,
|
secret_key => $secret_key,
|
||||||
|
@@ -37,6 +37,7 @@ class openstack::db::mysql (
|
|||||||
$keystone_db_password,
|
$keystone_db_password,
|
||||||
$glance_db_password,
|
$glance_db_password,
|
||||||
$nova_db_password,
|
$nova_db_password,
|
||||||
|
$cinder_db_password,
|
||||||
# MySQL
|
# MySQL
|
||||||
$mysql_bind_address = '0.0.0.0',
|
$mysql_bind_address = '0.0.0.0',
|
||||||
$mysql_account_security = true,
|
$mysql_account_security = true,
|
||||||
@@ -50,13 +51,16 @@ class openstack::db::mysql (
|
|||||||
$nova_db_user = 'nova',
|
$nova_db_user = 'nova',
|
||||||
$nova_db_dbname = 'nova',
|
$nova_db_dbname = 'nova',
|
||||||
$allowed_hosts = false,
|
$allowed_hosts = false,
|
||||||
|
# Cinder
|
||||||
|
$cinder_db_user = 'cinder',
|
||||||
|
$cinder_db_dbname = 'cinder',
|
||||||
$enabled = true
|
$enabled = true
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# Install and configure MySQL Server
|
# Install and configure MySQL Server
|
||||||
class { 'mysql::server':
|
class { 'mysql::server':
|
||||||
config_hash => {
|
config_hash => {
|
||||||
'root_password' => $mysql_root_password,
|
#'root_password' => $mysql_root_password,
|
||||||
'bind_address' => $mysql_bind_address,
|
'bind_address' => $mysql_bind_address,
|
||||||
},
|
},
|
||||||
enabled => $enabled,
|
enabled => $enabled,
|
||||||
@@ -91,5 +95,13 @@ class openstack::db::mysql (
|
|||||||
dbname => $nova_db_dbname,
|
dbname => $nova_db_dbname,
|
||||||
allowed_hosts => $allowed_hosts,
|
allowed_hosts => $allowed_hosts,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# create cinder db
|
||||||
|
class { 'cinder::db::mysql':
|
||||||
|
user => $cinder_db_user,
|
||||||
|
password => $cinder_db_password,
|
||||||
|
dbname => $cinder_db_dbname,
|
||||||
|
allowed_hosts => $allowed_hosts,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,6 +45,7 @@ class openstack::keystone (
|
|||||||
$admin_password,
|
$admin_password,
|
||||||
$glance_user_password,
|
$glance_user_password,
|
||||||
$nova_user_password,
|
$nova_user_password,
|
||||||
|
$cinder_user_password,
|
||||||
$public_address,
|
$public_address,
|
||||||
$db_type = 'mysql',
|
$db_type = 'mysql',
|
||||||
$db_user = 'keystone',
|
$db_user = 'keystone',
|
||||||
@@ -60,9 +61,13 @@ class openstack::keystone (
|
|||||||
$nova_public_address = $public_address,
|
$nova_public_address = $public_address,
|
||||||
$nova_internal_address = false,
|
$nova_internal_address = false,
|
||||||
$nova_admin_address = false,
|
$nova_admin_address = false,
|
||||||
|
$cinder_public_address = false,
|
||||||
|
$cinder_internal_address = false,
|
||||||
|
$cinder_admin_address = false,
|
||||||
$glance = true,
|
$glance = true,
|
||||||
$nova = true,
|
$nova = true,
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
|
$cinder = true,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# Install and configure Keystone
|
# Install and configure Keystone
|
||||||
@@ -104,6 +109,21 @@ class openstack::keystone (
|
|||||||
} else {
|
} else {
|
||||||
$nova_admin_real = $nova_internal_real
|
$nova_admin_real = $nova_internal_real
|
||||||
}
|
}
|
||||||
|
if($cinder_public_address) {
|
||||||
|
$cinder_public_real = $cinder_public_address
|
||||||
|
} else {
|
||||||
|
$cinder_public_real = $public_address
|
||||||
|
}
|
||||||
|
if($cinder_internal_address) {
|
||||||
|
$cinder_internal_real = $cinder_internal_address
|
||||||
|
} else {
|
||||||
|
$cinder_internal_real = $cinder_public_real
|
||||||
|
}
|
||||||
|
if($cinder_admin_address) {
|
||||||
|
$cinder_admin_real = $cinder_admin_address
|
||||||
|
} else {
|
||||||
|
$cinder_admin_real = $cinder_internal_real
|
||||||
|
}
|
||||||
|
|
||||||
class { '::keystone':
|
class { '::keystone':
|
||||||
log_verbose => $verbose,
|
log_verbose => $verbose,
|
||||||
@@ -148,6 +168,16 @@ class openstack::keystone (
|
|||||||
internal_address => $nova_internal_real,
|
internal_address => $nova_internal_real,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Configure Nova endpoint in Keystone
|
||||||
|
if $cinder {
|
||||||
|
class { 'cinder::keystone::auth':
|
||||||
|
password => $cinder_user_password,
|
||||||
|
public_address => $cinder_public_real,
|
||||||
|
admin_address => $cinder_admin_real,
|
||||||
|
internal_address => $cinder_internal_real,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user