Merge pull request #114 from bodepd/fix_cinder

refactor of openstack module
This commit is contained in:
Dan Bode
2012-10-25 16:12:46 -07:00
5 changed files with 346 additions and 232 deletions

View File

@@ -59,60 +59,66 @@
class openstack::all ( class openstack::all (
# Network Required # Network Required
$public_address, $public_address,
# MySQL Required
$mysql_root_password = 'sql_pass',
# Rabbit Required
$rabbit_password = 'rabbitpw',
# Keystone Required
$keystone_db_password = 'keystone_pass',
$keystone_admin_token = 'keystone_admin_token',
$admin_email = 'some_user@some_fake_email_address.foo',
$admin_password = 'ChangeMe',
# Nova Required
$nova_db_password = 'nova_pass',
$nova_user_password = 'nova_pass',
# Glance Required
$glance_db_password = 'glance_pass',
$glance_user_password = 'glance_pass',
# Horizon Required
$secret_key = 'dummy_secret_key',
# Network
$public_interface = 'eth0', $public_interface = 'eth0',
$private_interface = 'eth1', $private_interface = 'eth1',
$fixed_range = '10.0.0.0/24', # Database
$network_manager = 'nova.network.manager.FlatDHCPManager', $mysql_root_password = 'sql_pass',
$network_config = {},
$auto_assign_floating_ip = false,
$floating_range = false,
$create_networks = true,
$num_networks = 1,
# MySQL
$db_type = 'mysql', $db_type = 'mysql',
$mysql_account_security = true, $mysql_account_security = true,
$allowed_hosts = ['127.0.0.%'], $allowed_hosts = ['127.0.0.%'],
# Rabbit
$rabbit_user = 'nova',
# Keystone # Keystone
$admin_email = 'some_user@some_fake_email_address.foo',
$admin_password = 'ChangeMe',
$keystone_db_password = 'keystone_pass',
$keystone_db_user = 'keystone', $keystone_db_user = 'keystone',
$keystone_db_dbname = 'keystone', $keystone_db_dbname = 'keystone',
$keystone_admin_token = 'keystone_admin_token',
$keystone_admin_tenant = 'admin', $keystone_admin_tenant = 'admin',
# Nova $region = 'RegionOne',
$nova_db_user = 'nova', # Glance Required
$nova_db_dbname = 'nova', $glance_db_password = 'glance_pass',
$purge_nova_config = true,
# Glance
$glance_db_user = 'glance', $glance_db_user = 'glance',
$glance_db_dbname = 'glance', $glance_db_dbname = 'glance',
$glance_user_password = 'glance_pass',
# Nova
$nova_db_password = 'nova_pass',
$nova_db_user = 'nova',
$nova_db_dbname = 'nova',
$nova_user_password = 'nova_pass',
$purge_nova_config = true,
# Network
$network_manager = 'nova.network.manager.FlatDHCPManager',
$fixed_range = '10.0.0.0/24',
$floating_range = false,
$create_networks = true,
$num_networks = 1,
$auto_assign_floating_ip = false,
$network_config = {},
$quantum = true,
# Rabbit
$rabbit_password = 'rabbit_pw',
$rabbit_user = 'nova',
# Horizon # Horizon
$secret_key = 'dummy_secret_key',
$cache_server_ip = '127.0.0.1', $cache_server_ip = '127.0.0.1',
$cache_server_port = '11211', $cache_server_port = '11211',
$swift = false, $swift = false,
$quantum = false,
$horizon_app_links = undef, $horizon_app_links = undef,
# if the cinder management components should be installed
$cinder = true,
$cinder_user_password = 'cinder_user_pass',
$cinder_db_password = 'cinder_db_pass',
$cinder_db_user = 'cinder',
$cinder_db_dbname = 'cinder',
$volume_group = 'cinder-volumes',
$cinder_test = false,
#
$quantum_user_password = 'quantum_user_pass',
$quantum_db_password = 'quantum_db_pass',
$quantum_db_user = 'quantum',
$quantum_db_dbname = 'quantum',
# Virtaulization # Virtaulization
$libvirt_type = 'kvm', $libvirt_type = 'kvm',
# Volume
$nova_volume = 'nova-volumes',
# VNC # VNC
$vnc_enabled = true, $vnc_enabled = true,
# General # General
@@ -123,14 +129,17 @@ class openstack::all (
# Ensure things are run in order # Ensure things are run in order
Class['openstack::db::mysql'] -> Class['openstack::keystone'] Class['openstack::db::mysql'] -> Class['openstack::keystone']
Class['openstack::db::mysql'] -> Class['openstack::glance'] Class['openstack::db::mysql'] -> Class['openstack::glance']
Class['openstack::db::mysql'] -> Class['openstack::nova::controller']
# set up mysql server # set up mysql server
case $db_type { if ($db_type == 'mysql') {
'mysql': { if ($enabled) {
Class['glance::db::mysql'] -> Class['glance::registry']
$nova_db = "mysql://${nova_db_user}:${nova_db_password}@127.0.0.1/nova?charset=utf8"
} else {
$nova_db = false
}
class { 'openstack::db::mysql': class { 'openstack::db::mysql':
mysql_root_password => $mysql_root_password, mysql_root_password => $mysql_root_password,
mysql_bind_address => '127.0.0.1',
mysql_account_security => $mysql_account_security, mysql_account_security => $mysql_account_security,
keystone_db_user => $keystone_db_user, keystone_db_user => $keystone_db_user,
keystone_db_password => $keystone_db_password, keystone_db_password => $keystone_db_password,
@@ -141,28 +150,40 @@ class openstack::all (
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 => $cinder,
cinder_db_user => $cinder_db_user,
cinder_db_password => $cinder_db_password,
cinder_db_dbname => $cinder_db_dbname,
quantum => $quantum,
quantum_db_user => $quantum_db_user,
quantum_db_password => $quantum_db_password,
quantum_db_dbname => $quantum_db_dbname,
allowed_hosts => $allowed_hosts, allowed_hosts => $allowed_hosts,
} }
} }
}
####### KEYSTONE ########### ####### KEYSTONE ###########
class { 'openstack::keystone': class { 'openstack::keystone':
verbose => $verbose, verbose => $verbose,
db_type => $db_type, db_type => $db_type,
db_host => '127.0.0.1', db_host => '127.0.0.1',
keystone_db_password => $keystone_db_password, db_password => $keystone_db_password,
keystone_db_dbname => $keystone_db_dbname, db_name => $keystone_db_dbname,
keystone_db_user => $keystone_db_user, db_user => $keystone_db_user,
keystone_admin_token => $keystone_admin_token, admin_token => $keystone_admin_token,
keystone_admin_tenant => $keystone_admin_tenant, admin_tenant => $keystone_admin_tenant,
admin_email => $admin_email, admin_email => $admin_email,
admin_password => $admin_password, admin_password => $admin_password,
public_address => $public_address, public_address => $public_address,
internal_address => '127.0.0.1', internal_address => '127.0.0.1',
admin_address => '127.0.0.1', admin_address => '127.0.0.1',
region => $region,
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 => $cinder,
cinder_user_password => $cinder_user_password,
quantum => $quantum,
quantum_user_password => $quantum_user_password,
} }
######## GLANCE ########## ######## GLANCE ##########
@@ -174,6 +195,7 @@ class openstack::all (
glance_db_dbname => $glance_db_dbname, glance_db_dbname => $glance_db_dbname,
glance_db_password => $glance_db_password, glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password, glance_user_password => $glance_user_password,
enabled => $enabled,
} }
######## NOVA ########### ######## NOVA ###########
@@ -188,69 +210,109 @@ class openstack::all (
} }
} }
class { 'openstack::nova::controller': # Install / configure rabbitmq
# Network class { 'nova::rabbitmq':
network_manager => $network_manager, userid => $rabbit_user,
network_config => $network_config, password => $rabbit_password,
private_interface => $private_interface,
public_interface => $public_interface,
floating_range => $floating_range,
fixed_range => $fixed_range,
public_address => $public_address,
admin_address => '127.0.0.1',
internal_address => '127.0.0.1',
auto_assign_floating_ip => $auto_assign_floating_ip,
create_networks => $create_networks,
num_networks => $num_networks,
multi_host => false,
# Database
db_host => '127.0.0.1',
# Nova
nova_user_password => $nova_user_password,
nova_db_password => $nova_db_password,
nova_db_user => $nova_db_user,
nova_db_dbname => $nova_db_dbname,
# Rabbit
rabbit_user => $rabbit_user,
rabbit_password => $rabbit_password,
# Glance
glance_api_servers => '127.0.0.1:9292',
# VNC
vnc_enabled => $vnc_enabled,
# General
verbose => $verbose,
enabled => $enabled, enabled => $enabled,
exported_resources => false,
} }
class { 'openstack::nova::compute': # Configure Nova
# Network class { 'nova':
public_address => $public_address, sql_connection => $nova_db,
rabbit_userid => $rabbit_user,
rabbit_password => $rabbit_password,
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => 'localhost:9292',
verbose => $verbose,
rabbit_host => $internal_address,
}
# Configure nova-api
class { 'nova::api':
enabled => $enabled,
admin_password => $nova_user_password,
auth_host => 'localhost',
}
if $enabled {
$really_create_networks = $create_networks
} else {
$really_create_networks = false
}
if $quantum == false {
# Configure nova-network
class { 'nova::network':
private_interface => $private_interface, private_interface => $private_interface,
public_interface => $public_interface, public_interface => $public_interface,
fixed_range => $fixed_range, fixed_range => $fixed_range,
floating_range => $floating_range,
network_manager => $network_manager, network_manager => $network_manager,
network_config => $network_config, config_overrides => $network_config,
multi_host => false, create_networks => $really_create_networks,
internal_address => '127.0.0.1', num_networks => $num_networks,
# Virtualization
libvirt_type => $libvirt_type,
# Volumes
nova_volume => $nova_volume,
manage_volumes => true,
iscsi_ip_address => '127.0.0.1',
# VNC
vnc_enabled => $vnc_enabled,
vncproxy_host => $public_address,
# Nova
nova_user_password => $nova_user_password,
# Rabbit
rabbit_password => $rabbit_password,
# General
verbose => $verbose,
exported_resources => false,
enabled => $enabled, enabled => $enabled,
} }
} else {
# Set up Quantum
}
if $auto_assign_floating_ip {
nova_config { 'auto_assign_floating_ip': value => 'True' }
}
class { [
'nova::scheduler',
'nova::objectstore',
'nova::cert',
'nova::consoleauth'
]:
enabled => $enabled,
}
if $vnc_enabled {
class { 'nova::vncproxy':
host => $public_address,
enabled => $enabled,
}
}
######### Cinder Controller Services ########
if ($cinder) {
class { "cinder::base":
verbose => $verbose,
sql_connection => "mysql://${cinder_db_user}:${cinder_db_password}@127.0.0.1/${cinder_db_dbname}?charset=utf8",
rabbit_password => $rabbit_password,
}
class { 'cinder::api':
keystone_password => $cinder_user_password,
}
class { 'cinder::scheduler': }
class { 'cinder::volume': }
class { 'cinder::volume::iscsi':
volume_group => $volume_group,
test => $cinder_test,
}
} else {
# Set up nova-volume
}
# Install / configure nova-compute
class { '::nova::compute':
enabled => $enabled,
vnc_enabled => $vnc_enabled,
vncserver_proxyclient_address => $internal_address,
vncproxy_host => 'localhost',
}
# Configure libvirt for nova-compute
class { 'nova::compute::libvirt':
libvirt_type => $libvirt_type,
vncserver_listen => $internal_address,
}
######## Horizon ######## ######## Horizon ########
class { 'openstack::horizon': class { 'openstack::horizon':

View File

@@ -22,13 +22,20 @@ class openstack::compute (
$nova_user_password, $nova_user_password,
# Required Rabbit # Required Rabbit
$rabbit_password, $rabbit_password,
# Network
# DB # DB
$sql_connection = false, $sql_connection,
# Network
$quantum = true,
$public_interface = undef,
$private_interface = undef,
$fixed_range = undef,
$network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = {},
$multi_host = false,
# Nova # Nova
$purge_nova_config = true, $purge_nova_config = true,
# Rabbit # Rabbit
$rabbit_host = false, $rabbit_host = '127.0.0.1',
$rabbit_user = 'nova', $rabbit_user = 'nova',
# Glance # Glance
$glance_api_servers = false, $glance_api_servers = false,
@@ -37,11 +44,26 @@ class openstack::compute (
# VNC # VNC
$vnc_enabled = true, $vnc_enabled = true,
$vncproxy_host = undef, $vncproxy_host = undef,
$vncserver_listen = false,
# cinder / volumes
$cinder = true,
$cinder_sql_connection = undef,
$manage_volumes = true,
$nova_volume = 'cinder-volumes',
$iscsi_ip_address = '127.0.0.1',
# General # General
$migration_support = false,
$verbose = 'False', $verbose = 'False',
$enabled = true $enabled = true
) { ) {
if $vncserver_listen {
$vncserver_listen_real = $vncserver_listen
} else {
$vncserver_listen_real = $internal_address
}
# #
# indicates that all nova config entries that we did # indicates that all nova config entries that we did
# not specifify in Puppet should be purged from file # not specifify in Puppet should be purged from file
@@ -54,10 +76,6 @@ class openstack::compute (
} }
} }
$final_sql_connection = $sql_connection
$glance_connection = $glance_api_servers
$rabbit_connection = $rabbit_host
class { 'nova': class { 'nova':
sql_connection => $sql_connection, sql_connection => $sql_connection,
rabbit_userid => $rabbit_user, rabbit_userid => $rabbit_user,
@@ -79,21 +97,23 @@ class openstack::compute (
# Configure libvirt for nova-compute # Configure libvirt for nova-compute
class { 'nova::compute::libvirt': class { 'nova::compute::libvirt':
libvirt_type => $libvirt_type, libvirt_type => $libvirt_type,
vncserver_listen => $internal_address, vncserver_listen => $vncserver_listen_real,
migration_support => $migration_support,
} }
# if the compute node should be configured as a multi-host # if the compute node should be configured as a multi-host
# compute installation # compute installation
if $quantum == false {
if $multi_host { if $multi_host {
include keystone::python include keystone::python
#nova_config { nova_config {
# 'multi_host': value => 'True'; 'multi_host': value => 'True';
# 'send_arp_for_ha': value => 'True'; 'send_arp_for_ha': value => 'True';
#} }
#if ! $public_interface { if ! $public_interface {
# fail('public_interface must be defined for multi host compute nodes') fail('public_interface must be defined for multi host compute nodes')
#} }
#$enable_network_service = true $enable_network_service = true
class { 'nova::api': class { 'nova::api':
enabled => true, enabled => true,
admin_tenant_name => 'services', admin_tenant_name => 'services',
@@ -102,23 +122,44 @@ class openstack::compute (
# TODO override enabled_apis # TODO override enabled_apis
} }
} else { } else {
#$enable_network_service = false $enable_network_service = false
#nova_config { nova_config {
# 'multi_host': value => 'False'; 'multi_host': value => 'False';
# 'send_arp_for_ha': value => 'False'; 'send_arp_for_ha': value => 'False';
#} }
} }
#class { 'nova::network': class { 'nova::network':
# private_interface => $private_interface, private_interface => $private_interface,
# public_interface => $public_interface, public_interface => $public_interface,
# fixed_range => $fixed_range, fixed_range => $fixed_range,
# floating_range => false, floating_range => false,
# network_manager => $network_manager, network_manager => $network_manager,
# config_overrides => $network_config, config_overrides => $network_config,
# create_networks => false, create_networks => false,
# enabled => $enable_network_service, enabled => $enable_network_service,
# install_service => $enable_network_service, install_service => $enable_network_service,
#} }
} else {
# TODO install quantum
}
if ($cinder) {
class { 'cinder::base':
rabbit_password => $rabbit_password,
rabbit_host => $rabbit_host,
sql_connection => $cinder_sql_connection,
verbose => $verbose,
}
class { 'cinder::volume': }
class { 'cinder::volume::iscsi':
iscsi_ip_address => $internal_address,
volume_group => $nova_volume,
}
nova_config { 'volume_api_class': value => 'nova.volume.cinder.API' }
} else {
# Set up nova-volume
}
} }

View File

@@ -31,7 +31,6 @@
# [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] Whether to log services at verbose. # [verbose] Whether to log services at verbose.
# [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,
# [cache_server_ip] local memcached instance ip # [cache_server_ip] local memcached instance ip
@@ -67,35 +66,27 @@ class openstack::controller (
$public_address, $public_address,
$public_interface, $public_interface,
$private_interface, $private_interface,
# Required Database $admin_email,
$mysql_root_password = 'sql_pass', # required password
# Required Keystone $admin_password,
$admin_email = 'some_user@some_fake_email_address.foo', $rabbit_password,
$admin_password = 'ChangeMe', $keystone_db_password,
$keystone_db_password = 'keystone_pass', $keystone_admin_token,
$keystone_admin_token = 'keystone_admin_token', $glance_db_password,
# Required Glance $glance_user_password,
$glance_db_password = 'glance_pass', $nova_db_password,
$glance_user_password = 'glance_pass', $nova_user_password,
# Required Nova $secret_key,
$nova_db_password = 'nova_pass', # cinder and quantum password are not required b/c they are
$nova_user_password = 'nova_pass', # optional. Not sure what to do about this.
# Required Horizon $cinder_user_password = 'cinder_pass',
$secret_key = 'dummy_secret_key', $cinder_db_password = 'cinder_pass',
# not sure if this works correctly $quantum_user_password = 'quantum_pass',
$internal_address = $public_address, $quantum_db_password = 'quantum_pass',
$admin_address = $public_address,
$network_manager = 'nova.network.manager.FlatDHCPManager',
$fixed_range = '10.0.0.0/24',
$floating_range = false,
$create_networks = true,
$num_networks = 1,
$multi_host = false,
$auto_assign_floating_ip = false,
$network_config = {},
# Database # Database
$db_host = '127.0.0.1', $db_host = '127.0.0.1',
$db_type = 'mysql', $db_type = 'mysql',
$mysql_root_password = 'sql_pass',
$mysql_account_security = true, $mysql_account_security = true,
$mysql_bind_address = '0.0.0.0', $mysql_bind_address = '0.0.0.0',
$allowed_hosts = '%', $allowed_hosts = '%',
@@ -103,6 +94,7 @@ class openstack::controller (
$keystone_db_user = 'keystone', $keystone_db_user = 'keystone',
$keystone_db_dbname = 'keystone', $keystone_db_dbname = 'keystone',
$keystone_admin_tenant = 'admin', $keystone_admin_tenant = 'admin',
$region = 'RegionOne',
# Glance # Glance
$glance_db_user = 'glance', $glance_db_user = 'glance',
$glance_db_dbname = 'glance', $glance_db_dbname = 'glance',
@@ -111,32 +103,50 @@ class openstack::controller (
$nova_db_user = 'nova', $nova_db_user = 'nova',
$nova_db_dbname = 'nova', $nova_db_dbname = 'nova',
$purge_nova_config = true, $purge_nova_config = true,
# Network
$internal_address = false,
$admin_address = false,
$network_manager = 'nova.network.manager.FlatDHCPManager',
$fixed_range = '10.0.0.0/24',
$floating_range = false,
$create_networks = true,
$num_networks = 1,
$multi_host = false,
$auto_assign_floating_ip = false,
$network_config = {},
$quantum = true,
# Rabbit # Rabbit
$rabbit_password = 'rabbit_pw',
$rabbit_user = 'nova', $rabbit_user = 'nova',
# Horizon # Horizon
$cache_server_ip = '127.0.0.1', $cache_server_ip = '127.0.0.1',
$cache_server_port = '11211', $cache_server_port = '11211',
$swift = false,
$quantum = false,
$cinder = false,
$horizon_app_links = undef, $horizon_app_links = undef,
$swift = false,
# VNC
$vnc_enabled = true,
# General # General
$verbose = 'False', $verbose = 'False',
$export_resources = true,
# if the cinder management components should be installed # if the cinder management components should be installed
$cinder_user_password = 'cinder_user_pass', $cinder = false,
$cinder_db_password = 'cinder_db_pass',
$cinder_db_user = 'cinder', $cinder_db_user = 'cinder',
$cinder_db_dbname = 'cinder', $cinder_db_dbname = 'cinder',
# #
$quantum_user_password = 'quantum_user_pass',
$quantum_db_password = 'quantum_db_pass',
$quantum_db_user = 'quantum', $quantum_db_user = 'quantum',
$quantum_db_dbname = 'quantum', $quantum_db_dbname = 'quantum',
$enabled = true $enabled = true
) { ) {
if $internal_address {
$internal_address_real = $internal_address
} else {
$internal_address_real = $public_address
}
if $admin_address {
$admin_address_real = $admin_address
} else {
$admin_address_real = $public_address
}
# Ensure things are run in order # Ensure things are run in order
Class['openstack::db::mysql'] -> Class['openstack::keystone'] Class['openstack::db::mysql'] -> Class['openstack::keystone']
Class['openstack::db::mysql'] -> Class['openstack::glance'] Class['openstack::db::mysql'] -> Class['openstack::glance']
@@ -187,8 +197,9 @@ class openstack::controller (
admin_email => $admin_email, admin_email => $admin_email,
admin_password => $admin_password, admin_password => $admin_password,
public_address => $public_address, public_address => $public_address,
internal_address => $internal_address, internal_address => $internal_address_real,
admin_address => $admin_address, admin_address => $admin_address,
region => $region,
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 => $cinder, cinder => $cinder,
@@ -227,15 +238,18 @@ class openstack::controller (
db_host => $db_host, db_host => $db_host,
# Network # Network
network_manager => $network_manager, network_manager => $network_manager,
network_config => $network_config,
floating_range => $floating_range, floating_range => $floating_range,
fixed_range => $fixed_range, fixed_range => $fixed_range,
public_address => $public_address, public_address => $public_address,
admin_address => $admin_address, admin_address => $admin_address,
internal_address => $internal_address, internal_address => $internal_address_real,
auto_assign_floating_ip => $auto_assign_floating_ip, auto_assign_floating_ip => $auto_assign_floating_ip,
create_networks => $create_networks, create_networks => $create_networks,
num_networks => $num_networks, num_networks => $num_networks,
multi_host => $multi_host, multi_host => $multi_host,
public_interface => $public_interface,
private_interface => $private_interface,
quantum => $quantum, quantum => $quantum,
# Nova # Nova
nova_user_password => $nova_user_password, nova_user_password => $nova_user_password,
@@ -247,10 +261,11 @@ class openstack::controller (
rabbit_password => $rabbit_password, rabbit_password => $rabbit_password,
# Glance # Glance
glance_api_servers => $glance_api_servers, glance_api_servers => $glance_api_servers,
# VNC
vnc_enabled => $vnc_enabled,
# General # General
verbose => $verbose, verbose => $verbose,
enabled => $enabled, enabled => $enabled,
exported_resources => $export_resources,
} }
######### Cinder Controller Services ######## ######### Cinder Controller Services ########

View File

@@ -54,6 +54,7 @@ class openstack::keystone (
$admin_tenant = 'admin', $admin_tenant = 'admin',
$verbose = 'False', $verbose = 'False',
$bind_host = '0.0.0.0', $bind_host = '0.0.0.0',
$region = 'RegionOne',
$internal_address = false, $internal_address = false,
$admin_address = false, $admin_address = false,
$glance_public_address = false, $glance_public_address = false,
@@ -177,6 +178,7 @@ class openstack::keystone (
public_address => $public_address, public_address => $public_address,
admin_address => $admin_real, admin_address => $admin_real,
internal_address => $internal_real, internal_address => $internal_real,
region => $region,
} }
# Configure Glance endpoint in Keystone # Configure Glance endpoint in Keystone
@@ -186,6 +188,7 @@ class openstack::keystone (
public_address => $glance_public_real, public_address => $glance_public_real,
admin_address => $glance_admin_real, admin_address => $glance_admin_real,
internal_address => $glance_internal_real, internal_address => $glance_internal_real,
region => $region,
} }
} }
@@ -196,6 +199,7 @@ class openstack::keystone (
public_address => $nova_public_real, public_address => $nova_public_real,
admin_address => $nova_admin_real, admin_address => $nova_admin_real,
internal_address => $nova_internal_real, internal_address => $nova_internal_real,
region => $region,
} }
} }
@@ -206,6 +210,7 @@ class openstack::keystone (
public_address => $cinder_public_real, public_address => $cinder_public_real,
admin_address => $cinder_admin_real, admin_address => $cinder_admin_real,
internal_address => $cinder_internal_real, internal_address => $cinder_internal_real,
region => $region,
} }
} }
if $quantum { if $quantum {
@@ -214,6 +219,7 @@ class openstack::keystone (
public_address => $quantum_public_real, public_address => $quantum_public_real,
admin_address => $quantum_admin_real, admin_address => $quantum_admin_real,
internal_address => $quantum_internal_real, internal_address => $quantum_internal_real,
region => $region,
} }
} }
} }

View File

@@ -30,15 +30,18 @@ class openstack::nova::controller (
$nova_user_password, $nova_user_password,
$nova_db_password, $nova_db_password,
# Network # Network
$fixed_range = '10.0.0.0/24', $network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = {},
$floating_range = false, $floating_range = false,
$internal_address = $public_address, $fixed_range = '10.0.0.0/24',
$admin_address = $public_address, $admin_address = $public_address,
$internal_address = $public_address,
$auto_assign_floating_ip = false, $auto_assign_floating_ip = false,
$create_networks = true, $create_networks = true,
$num_networks = 1, $num_networks = 1,
$multi_host = false, $multi_host = false,
$network_manager = 'nova.network.manager.FlatDHCPManager', $public_interface = undef,
$private_interface = undef,
$quantum = true, $quantum = true,
# Nova # Nova
$nova_db_user = 'nova', $nova_db_user = 'nova',
@@ -55,7 +58,6 @@ class openstack::nova::controller (
$keystone_host = '127.0.0.1', $keystone_host = '127.0.0.1',
$verbose = 'False', $verbose = 'False',
$enabled = true, $enabled = true,
$exported_resources = true
) { ) {
# Configure the db string # Configure the db string
@@ -70,25 +72,10 @@ class openstack::nova::controller (
} else { } else {
$real_glance_api_servers = $glance_api_servers $real_glance_api_servers = $glance_api_servers
} }
if ($exported_resources) {
# export all of the things that will be needed by the clients
@@nova_config { 'rabbit_host': value => $internal_address }
Nova_config <| title == 'rabbit_host' |>
@@nova_config { 'sql_connection': value => $nova_db }
Nova_config <| title == 'sql_connection' |>
@@nova_config { 'glance_api_servers': value => $real_glance_api_servers }
Nova_config <| title == 'glance_api_servers' |>
$sql_connection = false
$glance_connection = false
$rabbit_connection = false
} else {
$sql_connection = $nova_db $sql_connection = $nova_db
$glance_connection = $real_glance_api_servers $glance_connection = $real_glance_api_servers
$rabbit_connection = $internal_address $rabbit_connection = $internal_address
}
# Install / configure rabbitmq # Install / configure rabbitmq
class { 'nova::rabbitmq': class { 'nova::rabbitmq':
@@ -115,6 +102,14 @@ class openstack::nova::controller (
auth_host => $keystone_host, auth_host => $keystone_host,
} }
if $enabled {
$really_create_networks = $create_networks
} else {
$really_create_networks = false
}
if $quantum == false {
# Configure nova-network # Configure nova-network
if $multi_host { if $multi_host {
nova_config { 'multi_host': value => 'True' } nova_config { 'multi_host': value => 'True' }
@@ -127,13 +122,6 @@ class openstack::nova::controller (
} }
} }
if $enabled {
$really_create_networks = $create_networks
} else {
$really_create_networks = false
}
if $quantum == false {
class { 'nova::network': class { 'nova::network':
private_interface => $private_interface, private_interface => $private_interface,
public_interface => $public_interface, public_interface => $public_interface,
@@ -146,6 +134,8 @@ class openstack::nova::controller (
enabled => $enable_network_service, enabled => $enable_network_service,
install_service => $enable_network_service, install_service => $enable_network_service,
} }
} else {
# Set up Quantum
} }
if $auto_assign_floating_ip { if $auto_assign_floating_ip {