Skip to content
Browse files

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.
  • Loading branch information...
1 parent 72d18a3 commit 073ff0d2db0590b8771c7a2580524bb7ecebd6f1 @bodepd committed Jul 26, 2012
View
42 manifests/all.pp
@@ -30,6 +30,25 @@
#
#
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
$public_interface = 'eth0',
$private_interface = 'eth1',
@@ -70,26 +89,7 @@
$vnc_enabled = true,
# General
$enabled = true,
- $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,
+ $verbose = false
) inherits openstack::params {
# set up mysql server
@@ -112,7 +112,7 @@
}
}
}
-
+
####### KEYSTONE ###########
class { 'openstack::keystone':
verbose => $verbose,
View
10 manifests/auth_file.pp
@@ -4,11 +4,11 @@
# against a keystone server.
#
class openstack::auth_file(
- $admin_password = $::openstack::params::admin_password,
- $public_address = $::openstack::params::public_address,
- $keystone_admin_token = $::openstack::params::keystone_admin_token,
- $admin_tenant = $::openstack::params::keystone_admin_tenant,
- $admin_user = 'admin'
+ $admin_password,
+ $controller_node = '127.0.0.1',
+ $keystone_admin_token = 'keystone_admin_token',
+ $admin_user = 'admin',
+ $admin_tenant = 'openstack'
) {
file { '/root/openrc':
content =>
View
5 manifests/controller.pp
@@ -84,6 +84,11 @@
$secret_key
) 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.
if (admin_address == undef) {
$real_admin_address = $public_address
View
72 manifests/db/mysql.pp
@@ -20,6 +20,12 @@
class openstack::db::mysql (
+ # Required MySQL
+ # passwords
+ $mysql_root_password,
+ $keystone_db_password,
+ $glance_db_password,
+ $nova_db_password
# MySQL
$mysql_bind_address = '0.0.0.0',
$mysql_account_security = true,
@@ -32,50 +38,48 @@
# Nova
$nova_db_user = 'nova',
$nova_db_dbname = 'nova',
- # Required MySQL
- $allowed_hosts,
- # Passwords
- $mysql_root_password,
- $keystone_db_password,
- $glance_db_password,
- $nova_db_password
+ $allowed_hosts = false,
+ $enabled = true
) {
# Install and configure MySQL Server
- class { 'mysql::server':
- config_hash => {
+ class { 'mysql::server':
+ config_hash => {
'root_password' => $mysql_root_password,
'bind_address' => $mysql_bind_address,
}
+ enabled => $enabled,
}
- # If enabled, secure the mysql installation
- # This removes default users and guest access
- if $mysql_account_security {
- class { 'mysql::server::account_security': }
- }
+ if $enabled {
+ # If enabled, secure the mysql installation
+ # This removes default users and guest access
+ if $mysql_account_security {
+ class { 'mysql::server::account_security': }
+ }
- # Create the Keystone db
- class { 'keystone::db::mysql':
- user => $keystone_db_user,
- password => $keystone_db_password,
- dbname => $keystone_db_dbname,
- allowed_hosts => $allowed_hosts,
- }
+ # Create the Keystone db
+ class { 'keystone::db::mysql':
+ user => $keystone_db_user,
+ password => $keystone_db_password,
+ dbname => $keystone_db_dbname,
+ allowed_hosts => $allowed_hosts,
+ }
- # Create the Glance db
- class { 'glance::db::mysql':
- user => $glance_db_user,
- password => $glance_db_password,
- dbname => $glance_db_dbname,
- allowed_hosts => $allowed_hosts,
- }
+ # Create the Glance db
+ class { 'glance::db::mysql':
+ user => $glance_db_user,
+ password => $glance_db_password,
+ dbname => $glance_db_dbname,
+ allowed_hosts => $allowed_hosts,
+ }
- # Create the Nova db
- class { 'nova::db::mysql':
- user => $nova_db_user,
- password => $nova_db_password,
- dbname => $nova_db_dbname,
- allowed_hosts => $allowed_hosts,
+ # Create the Nova db
+ class { 'nova::db::mysql':
+ user => $nova_db_user,
+ password => $nova_db_password,
+ dbname => $nova_db_dbname,
+ allowed_hosts => $allowed_hosts,
+ }
}
}
View
40 manifests/glance.pp
@@ -17,35 +17,20 @@
# class { 'openstack::glance':
# glance_user_password => 'changeme',
# db_password => 'changeme',
-# public_address => '192.168.1.1',
# db_host => '127.0.0.1',
# }
class openstack::glance (
+ $keystone_host,
+ $db_host,
+ $glance_user_password,
+ $glance_db_password,
$db_type = 'mysql',
$glance_db_user = 'glance',
$glance_db_dbname = 'glance',
- $admin_address = undef,
- $internal_address = undef,
$verbose = false,
- $db_host,
- $glance_user_password,
- $glance_db_password,
- $public_address,
-) inherits openstack::params {
-
- # Configure admin_address and internal address if needed.
- if (admin_address == undef) {
- $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
- }
+ $enabled = true
+) {
# Configure the db string
case $db_type {
@@ -59,31 +44,28 @@
log_verbose => $verbose,
log_debug => $verbose,
auth_type => 'keystone',
+ auth_port => '35357',
keystone_tenant => 'services',
keystone_user => 'glance',
keystone_password => $glance_user_password,
+ enabled => $enabled,
}
# Install and configure glance-registry
class { 'glance::registry':
log_verbose => $verbose,
log_debug => $verbose,
+ auth_host => $keystone_host,
+ auth_port => '35357',
auth_type => 'keystone',
keystone_tenant => 'services',
keystone_user => 'glance',
keystone_password => $glance_user_password,
sql_connection => $sql_connection,
+ enabled => $enabled,
}
# Configure file storage backend
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
2 manifests/horizon.pp
@@ -10,7 +10,7 @@
#
# === Examples
#
-# class { 'openstack::horizon':
+# class { 'openstack::horizon':
# secret_key => 'dummy_secret_key',
# }
#
View
8 manifests/keystone.pp
@@ -69,6 +69,14 @@
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
case $db_type {
'mysql': {
View
71 manifests/nova/compute.pp
@@ -15,7 +15,18 @@
# 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 (
+ # Required Network
+ $internal_address,
+ # Required Nova
+ $nova_user_password,
# Network
$public_address = undef,
$public_interface = 'eth0',
@@ -29,65 +40,23 @@
# Volumes
$nova_volume = 'nova-volumes',
$manage_volumes = true,
- $iscsi_ip_address = undef,
+ $iscsi_ip_address = $internal_address,
# VNC
$vnc_enabled = true,
- $vncserver_listen = undef,
$vncserver_proxyclient_address = undef,
$vncproxy_host = undef,
# General
$verbose = false,
$exported_resources = 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
- }
+ $enabled = true
+) {
# Install / configure nova-compute
class { '::nova::compute':
enabled => true,
vnc_enabled => $vnc_enabled,
- vncserver_proxyclient_address => $real_vncserver_proxyclient_address,
- vncproxy_host => $real_vncproxy_host,
+ vncserver_proxyclient_address => $internal_address,
+ vncproxy_host => $vncproxy_host,
}
# Configure libvirt for nova-compute
@@ -109,7 +78,7 @@
}
$enable_network_service = true
class { 'nova::api':
- enabled => $enabled,
+ enabled => true,
admin_tenant_name => 'services',
admin_user => 'nova',
admin_password => $nova_user_password,
@@ -128,10 +97,10 @@
private_interface => $private_interface,
public_interface => $public_interface,
fixed_range => $fixed_range,
- floating_range => false, # double check
+ floating_range => false,
network_manager => $network_manager,
config_overrides => $network_config,
- create_networks => false, # double check
+ create_networks => false,
enabled => $enable_network_service,
install_service => $enable_network_service,
}
@@ -145,7 +114,7 @@
if $enabled {
class { 'nova::volume::iscsi':
volume_group => $nova_volume,
- iscsi_ip_address => $internal_address,
+ iscsi_ip_address => $iscsi_ip_address,
}
}
}
View
5 manifests/nova/controller.pp
@@ -85,7 +85,6 @@
} else {
$real_glance_api_servers = $glance_api_servers
}
-
if ($export_resources) {
# export all of the things that will be needed by the clients
@@nova_config { 'rabbit_host': value => $internal_address }
@@ -108,11 +107,11 @@
$rabbit_connection = $internal_address
}
-
# Install / configure rabbitmq
class { 'nova::rabbitmq':
userid => $rabbit_user,
password => $rabbit_password,
+ enabled => $enabled,
}
# Configure Nova to use Keystone
@@ -148,7 +147,7 @@
if $enabled == true {
$enable_network_service = true
} else {
- $enable_network-service = false
+ $enable_network_service = false
}
}
View
2 manifests/test_file.pp
@@ -23,6 +23,6 @@
file { $path:
content => template('openstack/test_nova.sh.erb'),
- }
+ }
}

0 comments on commit 073ff0d

Please sign in to comment.
Something went wrong with that request. Please try again.