temporary commit.

This commit contains changes and notes related to the initial
code review between joe topjian and myself.

It is not intended to be merged, but it part of an ongoing
collaboration for a refactor of this module.
This commit is contained in:
Dan Bode
2012-07-26 10:30:10 -07:00
parent 7acaad1c54
commit 1e95338230
10 changed files with 113 additions and 145 deletions

View File

@@ -30,6 +30,25 @@
# #
# #
class openstack::all ( class openstack::all (
# Network Required
$public_address,
# MySQL Required
$mysql_root_password,
# Rabbit Required
$rabbit_password,
# Keystone Required
$keystone_db_password,
$keystone_admin_token,
$admin_email,
$admin_password,
# Nova Required
$nova_db_password,
$nova_user_password,
# Glance Required
$glance_db_password,
$glance_user_password,
# Horizon Required
$secret_key,
# Network # Network
$public_interface = 'eth0', $public_interface = 'eth0',
$private_interface = 'eth1', $private_interface = 'eth1',
@@ -70,26 +89,7 @@ class openstack::all (
$vnc_enabled = true, $vnc_enabled = true,
# General # General
$enabled = true, $enabled = true,
$verbose = false, $verbose = false
# Network Required
$public_address,
# MySQL Required
$mysql_root_password,
# Rabbit Required
$rabbit_password,
# Keystone Required
$keystone_db_password,
$keystone_admin_token,
$admin_email,
$admin_password,
# Nova Required
$nova_db_password,
$nova_user_password,
# Glance Required
$glance_db_password,
$glance_user_password,
# Horizon Required
$secret_key,
) inherits openstack::params { ) inherits openstack::params {
# set up mysql server # set up mysql server
@@ -112,6 +112,7 @@ class openstack::all (
} }
} }
} }
####### KEYSTONE ########### ####### KEYSTONE ###########
class { 'openstack::keystone': class { 'openstack::keystone':
verbose => $verbose, verbose => $verbose,

View File

@@ -4,11 +4,11 @@
# against a keystone server. # against a keystone server.
# #
class openstack::auth_file( class openstack::auth_file(
$admin_password = $::openstack::params::admin_password, $admin_password,
$public_address = $::openstack::params::public_address, $controller_node = '127.0.0.1',
$keystone_admin_token = $::openstack::params::keystone_admin_token, $keystone_admin_token = 'keystone_admin_token',
$admin_tenant = $::openstack::params::keystone_admin_tenant, $admin_user = 'admin',
$admin_user = 'admin' $admin_tenant = 'openstack'
) { ) {
file { '/root/openrc': file { '/root/openrc':
content => content =>

View File

@@ -84,6 +84,11 @@ class openstack::controller (
$secret_key $secret_key
) inherits openstack::params { ) inherits openstack::params {
## NOTE Class['glance::db::mysql'] -> Class['glance::registry']
## this dependency needs to exist (I forgot exactly why?)
# the db migration needs to happen after the dbs are created
# Configure admin_address and internal address if needed. # Configure admin_address and internal address if needed.
if (admin_address == undef) { if (admin_address == undef) {
$real_admin_address = $public_address $real_admin_address = $public_address

View File

@@ -20,6 +20,12 @@
class openstack::db::mysql ( class openstack::db::mysql (
# Required MySQL
# passwords
$mysql_root_password,
$keystone_db_password,
$glance_db_password,
$nova_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,
@@ -32,13 +38,8 @@ class openstack::db::mysql (
# Nova # Nova
$nova_db_user = 'nova', $nova_db_user = 'nova',
$nova_db_dbname = 'nova', $nova_db_dbname = 'nova',
# Required MySQL $allowed_hosts = false,
$allowed_hosts, $enabled = true
# Passwords
$mysql_root_password,
$keystone_db_password,
$glance_db_password,
$nova_db_password
) { ) {
# Install and configure MySQL Server # Install and configure MySQL Server
@@ -47,8 +48,10 @@ class openstack::db::mysql (
'root_password' => $mysql_root_password, 'root_password' => $mysql_root_password,
'bind_address' => $mysql_bind_address, 'bind_address' => $mysql_bind_address,
} }
enabled => $enabled,
} }
if $enabled {
# If enabled, secure the mysql installation # If enabled, secure the mysql installation
# This removes default users and guest access # This removes default users and guest access
if $mysql_account_security { if $mysql_account_security {
@@ -79,3 +82,4 @@ class openstack::db::mysql (
allowed_hosts => $allowed_hosts, allowed_hosts => $allowed_hosts,
} }
} }
}

View File

@@ -17,35 +17,20 @@
# class { 'openstack::glance': # class { 'openstack::glance':
# glance_user_password => 'changeme', # glance_user_password => 'changeme',
# db_password => 'changeme', # db_password => 'changeme',
# public_address => '192.168.1.1',
# db_host => '127.0.0.1', # db_host => '127.0.0.1',
# } # }
class openstack::glance ( class openstack::glance (
$db_type = 'mysql', $keystone_host,
$glance_db_user = 'glance',
$glance_db_dbname = 'glance',
$admin_address = undef,
$internal_address = undef,
$verbose = false,
$db_host, $db_host,
$glance_user_password, $glance_user_password,
$glance_db_password, $glance_db_password,
$public_address, $db_type = 'mysql',
) inherits openstack::params { $glance_db_user = 'glance',
$glance_db_dbname = 'glance',
# Configure admin_address and internal address if needed. $verbose = false,
if (admin_address == undef) { $enabled = true
$real_admin_address = $public_address ) {
} else {
$real_admin_address = $admin_address
}
if (internal_address == undef) {
$real_internal_address = $public_address
} else {
$real_internal_address = $internal_address
}
# Configure the db string # Configure the db string
case $db_type { case $db_type {
@@ -59,31 +44,28 @@ class openstack::glance (
log_verbose => $verbose, log_verbose => $verbose,
log_debug => $verbose, log_debug => $verbose,
auth_type => 'keystone', auth_type => 'keystone',
auth_port => '35357',
keystone_tenant => 'services', keystone_tenant => 'services',
keystone_user => 'glance', keystone_user => 'glance',
keystone_password => $glance_user_password, keystone_password => $glance_user_password,
enabled => $enabled,
} }
# Install and configure glance-registry # Install and configure glance-registry
class { 'glance::registry': class { 'glance::registry':
log_verbose => $verbose, log_verbose => $verbose,
log_debug => $verbose, log_debug => $verbose,
auth_host => $keystone_host,
auth_port => '35357',
auth_type => 'keystone', auth_type => 'keystone',
keystone_tenant => 'services', keystone_tenant => 'services',
keystone_user => 'glance', keystone_user => 'glance',
keystone_password => $glance_user_password, keystone_password => $glance_user_password,
sql_connection => $sql_connection, sql_connection => $sql_connection,
enabled => $enabled,
} }
# Configure file storage backend # Configure file storage backend
class { 'glance::backend::file': } class { 'glance::backend::file': }
# Configure Glance to use Keystone
class { 'glance::keystone::auth':
password => $glance_user_password,
public_address => $public_address,
admin_address => $real_admin_address,
internal_address => $real_internal_address,
}
} }

View File

@@ -69,6 +69,14 @@ class openstack::keystone (
internal_address => $real_internal_address, internal_address => $real_internal_address,
} }
# Configure Glance to use Keystone
class { 'glance::keystone::auth':
password => $glance_user_password,
public_address => $public_address,
admin_address => $real_admin_address,
internal_address => $real_internal_address,
}
# Configure the Keystone database # Configure the Keystone database
case $db_type { case $db_type {
'mysql': { 'mysql': {

View File

@@ -15,7 +15,18 @@
# nova_user_password => 'changeme', # nova_user_password => 'changeme',
# } # }
# NOTE this file should not actually change from the old openstack::compute
# class its worth doing a diff of the old file to better understadn the differneces
#
# NOTE move this to openstack::compute
# NOTE grab all of the missing logic from openstack::compute
class openstack::nova::compute ( class openstack::nova::compute (
# Required Network
$internal_address,
# Required Nova
$nova_user_password,
# Network # Network
$public_address = undef, $public_address = undef,
$public_interface = 'eth0', $public_interface = 'eth0',
@@ -29,65 +40,23 @@ class openstack::nova::compute (
# Volumes # Volumes
$nova_volume = 'nova-volumes', $nova_volume = 'nova-volumes',
$manage_volumes = true, $manage_volumes = true,
$iscsi_ip_address = undef, $iscsi_ip_address = $internal_address,
# VNC # VNC
$vnc_enabled = true, $vnc_enabled = true,
$vncserver_listen = undef,
$vncserver_proxyclient_address = undef, $vncserver_proxyclient_address = undef,
$vncproxy_host = undef, $vncproxy_host = undef,
# General # General
$verbose = false, $verbose = false,
$exported_resources = true, $exported_resources = true,
$enabled = true, $enabled = true
# Required Network ) {
$internal_address,
# Required Nova
$nova_user_password
) inherits openstack::params {
# Set iscsi ip address if not set
if ($iscsi_ip_address == undef) {
$real_iscsi_ip_address = $internal_address
} else {
$real_iscsi_ip_address = $iscsi_ip_address
}
# Configure VNC variables
if ($vnc_enabled == true) {
if ($vncserver_listen == undef) {
$real_vncserver_listen = $internal_address
} else {
$real_vncserver_listen = $vncserver_listen
}
if ($vncserver_proxyclient_address == undef) {
$real_vncserver_proxyclient_address = $internal_address
} else {
$real_vncserver_proxyclient_address = $vncserver_proxyclient_address
}
if ($vncproxy_host == undef) {
if ($multi_host == true and $public_address != undef) {
$real_vncproxy_host = $public_address
} else {
fail('vncproxy_host must be set.')
}
} else {
# This should be the public IP of the cloud controller...
$real_vncproxy_host = $vncproxy_host
}
} else {
$real_vncserver_listen = undef
$real_vncserver_proxyclient_address = undef
$real_vncproxy_host = undef
}
# Install / configure nova-compute # Install / configure nova-compute
class { '::nova::compute': class { '::nova::compute':
enabled => true, enabled => true,
vnc_enabled => $vnc_enabled, vnc_enabled => $vnc_enabled,
vncserver_proxyclient_address => $real_vncserver_proxyclient_address, vncserver_proxyclient_address => $internal_address,
vncproxy_host => $real_vncproxy_host, vncproxy_host => $vncproxy_host,
} }
# Configure libvirt for nova-compute # Configure libvirt for nova-compute
@@ -109,7 +78,7 @@ class openstack::nova::compute (
} }
$enable_network_service = true $enable_network_service = true
class { 'nova::api': class { 'nova::api':
enabled => $enabled, enabled => true,
admin_tenant_name => 'services', admin_tenant_name => 'services',
admin_user => 'nova', admin_user => 'nova',
admin_password => $nova_user_password, admin_password => $nova_user_password,
@@ -128,10 +97,10 @@ class openstack::nova::compute (
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, # double check floating_range => false,
network_manager => $network_manager, network_manager => $network_manager,
config_overrides => $network_config, config_overrides => $network_config,
create_networks => false, # double check create_networks => false,
enabled => $enable_network_service, enabled => $enable_network_service,
install_service => $enable_network_service, install_service => $enable_network_service,
} }
@@ -145,7 +114,7 @@ class openstack::nova::compute (
if $enabled { if $enabled {
class { 'nova::volume::iscsi': class { 'nova::volume::iscsi':
volume_group => $nova_volume, volume_group => $nova_volume,
iscsi_ip_address => $internal_address, iscsi_ip_address => $iscsi_ip_address,
} }
} }
} }

View File

@@ -85,7 +85,6 @@ class openstack::nova::controller (
} else { } else {
$real_glance_api_servers = $glance_api_servers $real_glance_api_servers = $glance_api_servers
} }
if ($export_resources) { if ($export_resources) {
# export all of the things that will be needed by the clients # export all of the things that will be needed by the clients
@@nova_config { 'rabbit_host': value => $internal_address } @@nova_config { 'rabbit_host': value => $internal_address }
@@ -108,11 +107,11 @@ class openstack::nova::controller (
$rabbit_connection = $internal_address $rabbit_connection = $internal_address
} }
# Install / configure rabbitmq # Install / configure rabbitmq
class { 'nova::rabbitmq': class { 'nova::rabbitmq':
userid => $rabbit_user, userid => $rabbit_user,
password => $rabbit_password, password => $rabbit_password,
enabled => $enabled,
} }
# Configure Nova to use Keystone # Configure Nova to use Keystone
@@ -148,7 +147,7 @@ class openstack::nova::controller (
if $enabled == true { if $enabled == true {
$enable_network_service = true $enable_network_service = true
} else { } else {
$enable_network-service = false $enable_network_service = false
} }
} }