Began putting params in individual manifests instead of a single params.pp file.

This commit is contained in:
Joe Topjian
2012-07-25 22:11:47 +00:00
committed by Dan Bode
parent 89beb232e4
commit 7acaad1c54
13 changed files with 464 additions and 599 deletions

View File

@@ -10,12 +10,18 @@
# === Examples # === Examples
# #
# class { 'openstack::all': # class { 'openstack::all':
# public_address => '192.168.0.3', # public_address => '192.168.1.1',
# public_interface => 'eth0', # mysql_root_password => 'changeme',
# private_interface => 'eth1', # rabbit_password => 'changeme',
# keystone_db_password => 'changeme',
# keystone_admin_token => '12345',
# admin_email => 'my_email@mw.com', # admin_email => 'my_email@mw.com',
# admin_password => 'my_admin_password', # admin_password => 'my_admin_password',
# libvirt_type => 'kvm', # nova_db_password => 'changeme',
# nova_user_password => 'changeme',
# glance_db_password => 'changeme',
# glance_user_password => 'changeme',
# secret_key => 'dummy_secret_key',
# } # }
# #
# === Authors # === Authors
@@ -25,57 +31,65 @@
# #
class openstack::all ( class openstack::all (
# Network # Network
$public_address = $::openstack::params::public_address, $public_interface = 'eth0',
$public_interface = $::openstack::params::public_interface, $private_interface = 'eth1',
$private_interface = $::openstack::params::private_interface, $fixed_range = '10.0.0.0/24',
$fixed_range = $::openstack::params::fixed_range, $network_manager = 'nova.network.manager.FlatDHCPManager',
$network_manager = $::openstack::params::network_manager, $network_config = {},
$network_config = $::openstack::params::network_config, $auto_assign_floating_ip = false,
$auto_assign_floating_ip = $::openstack::params::auto_assign_floating_ip, $floating_range = false,
$floating_range = $::openstack::params::floating_range, $create_networks = true,
$create_networks = $::openstack::params::create_networks, $num_networks = 1,
$num_networks = $::openstack::params::num_networks,
# MySQL # MySQL
$db_type = $::openstack::params::db_type, $db_type = 'mysql',
$mysql_root_password = $::openstack::params::mysql_root_password, $mysql_account_security = true,
$mysql_account_security = $::openstack::params::mysql_account_security, $allowed_hosts = ['127.0.0.%'],
# Rabbit # Rabbit
$rabbit_password = $::openstack::params::rabbit_password, $rabbit_user = 'nova',
$rabbit_user = $::openstack::params::rabbit_user,
# Keystone # Keystone
$admin_email = $::openstack::params::admin_email, $keystone_db_user = 'keystone',
$admin_password = $::openstack::params::admin_password, $keystone_db_dbname = 'keystone',
$keystone_db_user = $::openstack::params::keystone_db_user,
$keystone_db_password = $::openstack::params::keystone_db_password,
$keystone_db_dbname = $::openstack::params::keystone_db_dbname,
$keystone_admin_token = $::openstack::params::keystone_admin_token,
# Nova # Nova
$nova_db_user = $::openstack::params::nova_db_user, $nova_db_user = 'nova',
$nova_db_password = $::openstack::params::nova_db_password, $nova_db_dbname = 'nova',
$nova_user_password = $::openstack::params::nova_user_password, $purge_nova_config = true,
$nova_db_dbname = $::openstack::params::nova_db_dbname,
$purge_nova_config = $::openstack::params::purge_nova_config,
# Glance # Glance
$glance_db_user = $::openstack::params::glance_db_user, $glance_db_user = 'glance',
$glance_db_password = $::openstack::params::glance_db_password, $glance_db_dbname = 'glance',
$glance_db_dbname = $::openstack::params::glance_db_dbname,
$glance_user_password = $::openstack::params::glance_user_password,
# Horizon # Horizon
$secret_key = $::openstack::params::secret_key, $cache_server_ip = '127.0.0.1',
$cache_server_ip = $::openstack::params::cache_server_ip, $cache_server_port = '11211',
$cache_server_port = $::openstack::params::cache_server_port, $swift = false,
$swift = $::openstack::params::swift, $quantum = false,
$quantum = $::openstack::params::quantum, $horizon_app_links = undef,
$horizon_app_links = $::openstack::params::horizon_app_links,
# Virtaulization # Virtaulization
$libvirt_type = $::openstack::params::libvirt_type, $libvirt_type = 'kvm',
# Volume # Volume
$nova_volume = $::openstack::params::nova_volume, $nova_volume = 'nova-volumes',
# VNC # VNC
$vnc_enabled = $::openstack::params::vnc_enabled, $vnc_enabled = true,
# General # General
$enabled = $::openstack::params::enabled, $enabled = true,
$verbose = $::openstack::params::verbose $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
@@ -94,6 +108,7 @@ 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,
allowed_hosts => $allowed_hosts,
} }
} }
} }
@@ -154,6 +169,8 @@ class openstack::all (
create_networks => $create_networks, create_networks => $create_networks,
num_networks => $num_networks, num_networks => $num_networks,
multi_host => false, multi_host => false,
# Database
db_host => '127.0.0.1',
# Nova # Nova
nova_user_password => $nova_user_password, nova_user_password => $nova_user_password,
nova_db_password => $nova_db_password, nova_db_password => $nova_db_password,
@@ -181,6 +198,7 @@ class openstack::all (
network_manager => $network_manager, network_manager => $network_manager,
network_config => $network_config, network_config => $network_config,
multi_host => false, multi_host => false,
internal_address => '127.0.0.1',
# Virtualization # Virtualization
libvirt_type => $libvirt_type, libvirt_type => $libvirt_type,
# Volumes # Volumes

View File

@@ -16,44 +16,51 @@
# === Examples # === Examples
# #
# class { 'openstack::compute': # class { 'openstack::compute':
# libvirt_type => 'kvm', # internal_address => '192.168.1.12',
# vncproxy_host => '192.168.1.1',
# nova_user_password => 'changeme',
# rabbit_password => 'changeme',
# } # }
# #
class openstack::compute ( class openstack::compute (
# Network # Network
$public_address = $::openstack::params::public_address, $public_address = undef,
$public_interface = $::openstack::params::public_interface, $public_interface = 'eth0',
$private_interface = $::openstack::params::private_interface, $private_interface = 'eth1',
$internal_address = $::openstack::params::internal_address, $fixed_range = '10.0.0.0/24',
$fixed_range = $::openstack::params::fixed_range, $network_manager = 'nova.network.manager.FlatDHCPManager',
$network_manager = $::openstack::params::network_manager, $multi_host = false,
$multi_host = $::openstack::params::multi_host, $network_config = {},
$network_config = $::openstack::params::network_config,
# DB # DB
$sql_connection = $::openstack::params::sql_connection, $sql_connection = false,
# Nova # Nova
$nova_user_password = $::openstack::params::nova_user_password, $purge_nova_config = true,
$purge_nova_config = $::openstack::params::purge_nova_config,
# Rabbit # Rabbit
$rabbit_host = $::openstack::params::rabbit_host, $rabbit_host = false,
$rabbit_password = $::openstack::params::rabbit_password, $rabbit_user = 'nova',
$rabbit_user = $::openstack::params::rabbit_user,
# Glance # Glance
$glance_api_servers = false, $glance_api_servers = false,
# Virtualization # Virtualization
$libvirt_type = $::openstack::params::libvirt_type, $libvirt_type = 'kvm',
# VNC # VNC
$vncproxy_host = $::openstack::params::vncproxy_host, $vnc_enabled = true,
$vnc_enabled = $::openstack::params::vnc_enabled, $vncserver_listen = undef,
$vncserver_proxyclient_address = $::openstack::params::vncserver_proxyclient_address, $vncproxy_host = undef,
$vncserver_proxyclient_address = undef,
# Volumes # Volumes
$manage_volumes = $::openstack::params::manage_volumes, $manage_volumes = true,
$nova_volume = $::openstack::params::nova_volume, $nova_volume = 'nova-volumes',
# General # General
$verbose = $::openstack::params::verbose, $verbose = false,
$exported_resources = $::openstack::params::exported_resources, $exported_resources = true,
$enabled = $::openstack::params::enabled $enabled = true,
# Required Network
$internal_address,
# Required Nova
$nova_user_password,
# Required Rabbit
$rabbit_password
) inherits openstack::params { ) inherits openstack::params {
# #
@@ -90,10 +97,41 @@ class openstack::compute (
} }
} }
# 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
}
if $enabled { if $enabled {
class { 'openstack::nova::compute': class { 'openstack::nova::compute':
# Network # Network
public_address => $public_address, public_address => $public_address,
internal_address => $internal_address,
private_interface => $private_interface, private_interface => $private_interface,
public_interface => $public_interface, public_interface => $public_interface,
fixed_range => $fixed_range, fixed_range => $fixed_range,
@@ -108,9 +146,9 @@ class openstack::compute (
iscsi_ip_address => $iscsi_ip_address, iscsi_ip_address => $iscsi_ip_address,
# VNC # VNC
vnc_enabled => $vnc_enabled, vnc_enabled => $vnc_enabled,
vncserver_listen => $vnc_server_listen, vncserver_listen => $real_vncserver_listen,
vncserver_proxyclient_address => $vncserver_proxyclient_address, vncserver_proxyclient_address => $real_vncserver_proxyclient_address,
vncproxy_host => $vncproxy_host, vncproxy_host => $real_vncproxy_host,
# Nova # Nova
nova_user_password => $nova_user_password, nova_user_password => $nova_user_password,
# General # General

View File

@@ -9,67 +9,94 @@
# #
# class { 'openstack::controller': # class { 'openstack::controller':
# public_address => '192.168.0.3', # public_address => '192.168.0.3',
# public_interface => 'eth0', # mysql_root_password => 'changeme',
# private_interface => 'eth1', # allowed_hosts => ['127.0.0.%', '192.168.1.%'],
# admin_email => 'my_email@mw.com', # admin_email => 'my_email@mw.com',
# admin_password => 'my_admin_password', # admin_password => 'my_admin_password',
# keystone_db_password => 'changeme',
# keystone_admin_token => '12345',
# glance_db_password => 'changeme',
# glance_user_password => 'changeme',
# nova_db_password => 'changeme',
# nova_user_password => 'changeme',
# secret_key => 'dummy_secret_key',
# } # }
# #
class openstack::controller ( class openstack::controller (
# Network # Network
$public_address = $::openstack::params::public_address, $public_interface = 'eth0',
$public_interface = $::openstack::params::public_interface, $private_interface = 'eth1',
$private_interface = $::openstack::params::private_interface, $internal_address = undef,
$internal_address = $::openstack::params::internal_address, $admin_address = undef,
$admin_address = $::openstack::params::admin_address, $network_manager = 'nova.network.manager.FlatDHCPManager',
$network_manager = $::openstack::params::network_manager, $fixed_range = '10.0.0.0/24',
$fixed_range = $::openstack::params::fixed_range, $floating_range = false,
$floating_range = $::openstack::params::floating_range, $create_networks = true,
$create_networks = $::openstack::params::create_networks, $num_networks = 1,
$num_networks = $::openstack::params::num_networks, $multi_host = false,
$multi_host = $::openstack::params::multi_host, $auto_assign_floating_ip = false,
$auto_assign_floating_ip = $::openstack::params::auto_assign_floating_ip, $network_config = {},
$network_config = $::openstack::params::network_config,
# Database # Database
$db_type = $::openstack::params::db_type, $db_type = 'mysql',
$mysql_root_password = $::openstack::params::mysql_root_password, $mysql_account_security = true,
$mysql_account_security = $::openstack::params::mysql_account_security, $mysql_bind_address = '0.0.0.0',
$mysql_bind_address = $::openstack::params::mysql_bind_address, $allowed_hosts = ['127.0.0.%'],
# Keystone # Keystone
$admin_email = $::openstack::params::admin_email, $keystone_db_user = 'keystone',
$admin_password = $::openstack::params::admin_password, $keystone_db_dbname = 'keystone',
$keystone_db_user = $::openstack::params::keystone_db_user,
$keystone_db_password = $::openstack::params::keystone_db_password,
$keystone_db_dbname = $::openstack::params::keystone_db_dbname,
$keystone_admin_token = $::openstack::params::keystone_admin_token,
# Glance # Glance
$glance_db_user = $::openstack::params::glance_db_user, $glance_db_user = 'glance',
$glance_db_password = $::openstack::params::glance_db_password, $glance_db_dbname = 'glance',
$glance_db_dbname = $::openstack::params::glance_db_dbname, $glance_api_servers = undef,
$glance_user_password = $::openstack::params::glance_user_password,
$glance_api_servers = $::openstack::params::glance_api_servers,
# Nova # Nova
$nova_db_user = $::openstack::params::nova_db_user, $nova_db_user = 'nova',
$nova_db_password = $::openstack::params::nova_db_password, $nova_db_dbname = 'nova',
$nova_user_password = $::openstack::params::nova_user_password, $purge_nova_config = true,
$nova_db_dbname = $::openstack::params::nova_db_dbname,
$purge_nova_config = $::openstack::params::purge_nova_config,
# Rabbit # Rabbit
$rabbit_password = $::openstack::params::rabbit_password, $rabbit_password,
$rabbit_user = $::openstack::params::rabbit_user, $rabbit_user = 'nova',
# Horizon # Horizon
$secret_key = $::openstack::params::secret_key, $cache_server_ip = '127.0.0.1',
$cache_server_ip = $::openstack::params::cache_server_ip, $cache_server_port = '11211',
$cache_server_port = $::openstack::params::cache_server_port, $swift = false,
$swift = $::openstack::params::swift, $quantum = false,
$quantum = $::openstack::params::quantum, $horizon_app_links = undef,
$horizon_app_links = $::openstack::params::horizon_app_links,
# General # General
$verbose = $::openstack::params::verbose, $verbose = false,
$exported_resources = $::openstack::params::exported_resources, $exported_resources = true,
$enabled = $::openstack::params::enabled $enabled = true,
# Required Network
$public_address,
# Required Database
$mysql_root_password,
# Required Keystone
$admin_email,
$admin_password,
$keystone_db_password,
$keystone_admin_token,
# Required Glance
$glance_db_password,
$glance_user_password,
# Required Nova
$nova_db_password,
$nova_user_password,
# Required Horizon
$secret_key
) inherits openstack::params { ) 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
}
####### DATABASE SETUP ###### ####### DATABASE SETUP ######
if $enabled { if $enabled {
# set up mysql server # set up mysql server
@@ -79,6 +106,7 @@ class openstack::controller (
mysql_root_password => $mysql_root_password, mysql_root_password => $mysql_root_password,
mysql_bind_address => $mysql_bind_address, mysql_bind_address => $mysql_bind_address,
mysql_account_security => $mysql_account_security, mysql_account_security => $mysql_account_security,
allowed_hosts => $allowed_hosts,
keystone_db_user => $keystone_db_user, keystone_db_user => $keystone_db_user,
keystone_db_password => $keystone_db_password, keystone_db_password => $keystone_db_password,
keystone_db_dbname => $keystone_db_dbname, keystone_db_dbname => $keystone_db_dbname,
@@ -140,6 +168,8 @@ class openstack::controller (
if $enabled { if $enabled {
class { 'openstack::nova::controller': class { 'openstack::nova::controller':
# Database
db_host => '127.0.0.1',
# Network # Network
network_manager => $network_manager, network_manager => $network_manager,
network_config => $network_config, network_config => $network_config,

View File

@@ -21,22 +21,24 @@
class openstack::db::mysql ( class openstack::db::mysql (
# MySQL # MySQL
$mysql_bind_address = $::openstack::params::mysql_bind_address, $mysql_bind_address = '0.0.0.0',
$allowed_hosts = $::openstack::params::mysql_allowed_hosts, $mysql_account_security = true,
$mysql_root_password = $::openstack::params::mysql_root_password,
$mysql_account_security = $::openstack::params::mysql_account_security,
# Keystone # Keystone
$keystone_db_user = $::openstack::params::keystone_db_user, $keystone_db_user = 'keystone',
$keystone_db_dbname = $::openstack::params::keystone_db_dbname, $keystone_db_dbname = 'keystone',
$keystone_db_password = $::openstack::params::keystone_db_password,
# Glance # Glance
$glance_db_user = $::openstack::params::glance_db_user, $glance_db_user = 'glance',
$glance_db_dbname = $::openstack::params::glance_db_dbname, $glance_db_dbname = 'glance',
$glance_db_password = $::openstack::params::glance_db_password,
# Nova # Nova
$nova_db_user = $::openstack::params::nova_db_user, $nova_db_user = 'nova',
$nova_db_dbname = $::openstack::params::nova_db_dbname, $nova_db_dbname = 'nova',
$nova_db_password = $::openstack::params::nova_db_password # Required MySQL
$allowed_hosts,
# Passwords
$mysql_root_password,
$keystone_db_password,
$glance_db_password,
$nova_db_password
) { ) {
# Install and configure MySQL Server # Install and configure MySQL Server

View File

@@ -18,23 +18,35 @@
# glance_user_password => 'changeme', # glance_user_password => 'changeme',
# db_password => 'changeme', # db_password => 'changeme',
# public_address => '192.168.1.1', # public_address => '192.168.1.1',
# admin_addresss => '192.168.1.1', # db_host => '127.0.0.1',
# internal_address => '192.168.1.1',
# } # }
class openstack::glance ( class openstack::glance (
$db_type = $::openstack::params::db_type, $db_type = 'mysql',
$db_host = $::openstack::params::db_host, $glance_db_user = 'glance',
$glance_db_user = $::openstack::params::glance_db_user, $glance_db_dbname = 'glance',
$glance_db_dbname = $::openstack::params::glance_db_dbname, $admin_address = undef,
$glance_user_password = $::openstack::params::glance_user_password, $internal_address = undef,
$glance_db_password = $::openstack::params::glance_db_password, $verbose = false,
$public_address = $::openstack::params::public_address, $db_host,
$admin_address = $::openstack::params::admin_address, $glance_user_password,
$internal_address = $::openstack::params::internal_address, $glance_db_password,
$verbose = $::openstack::params::verbose $public_address,
) inherits openstack::params { ) 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
}
# Configure the db string # Configure the db string
case $db_type { case $db_type {
'mysql': { 'mysql': {
@@ -70,8 +82,8 @@ class openstack::glance (
class { 'glance::keystone::auth': class { 'glance::keystone::auth':
password => $glance_user_password, password => $glance_user_password,
public_address => $public_address, public_address => $public_address,
admin_address => $admin_address, admin_address => $real_admin_address,
internal_address => $internal_address, internal_address => $real_internal_address,
} }
} }

View File

@@ -8,14 +8,20 @@
# #
# See params.pp # See params.pp
# #
# === Examples
#
# class { 'openstack::horizon':
# secret_key => 'dummy_secret_key',
# }
#
class openstack::horizon ( class openstack::horizon (
$secret_key = $::openstack::params::secret_key, $cache_server_ip = '127.0.0.1',
$cache_server_ip = $::openstack::params::cache_server_ip, $cache_server_port = '11211',
$cache_server_port = $::openstack::params::cache_server_port, $swift = false,
$swift = $::openstack::params::swift, $quantum = false,
$quantum = $::openstack::params::quantum, $horizon_app_links = undef,
$horizon_app_links = $::openstack::params::horizon_app_links $secret_key
) { ) {
class { 'memcached': class { 'memcached':

View File

@@ -10,31 +10,43 @@
# === Example # === Example
# #
# class { 'openstack::keystone': # class { 'openstack::keystone':
# db_password => 'changeme', # db_host => '127.0.0.1',
# admin_token => '12345', # keystone_db_password => 'changeme',
# keystone_admin_token => '12345',
# admin_email => 'root@localhost', # admin_email => 'root@localhost',
# admin_password => 'changeme', # admin_password => 'changeme',
# public_address => '192.168.1.1', # public_address => '192.168.1.1',
# admin_addresss => '192.168.1.1',
# internal_address => '192.168.1.1',
# } # }
class openstack::keystone ( class openstack::keystone (
$db_type = $::openstack::params::db_type, $db_type = 'mysql',
$db_host = $::openstack::params::db_host, $keystone_db_user = 'keystone',
$keystone_db_user = $::openstack::params::keystone_db_user, $keystone_db_dbname = 'keystone',
$keystone_db_password = $::openstack::params::keystone_db_password, $keystone_admin_tenant = 'admin',
$keystone_db_dbname = $::openstack::params::keystone_db_dbname, $admin_address = undef,
$keystone_admin_tenant = $::openstack::params::keystone_admin_tenant, $internal_address = undef,
$keystone_admin_token = $::openstack::params::keystone_admin_token, $verbose = false,
$admin_email = $::openstack::params::admin_email, $db_host,
$admin_password = $::openstack::params::admin_password, $keystone_db_password,
$public_address = $::openstack::params::public_address, $keystone_admin_token,
$admin_address = $::openstack::params::admin_address, $admin_email,
$internal_address = $::openstack::params::internal_address, $admin_password,
$verbose = $::openstack::params::verbose $public_address
) inherits openstack::params { ) 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
}
# Install and configure Keystone # Install and configure Keystone
class { '::keystone': class { '::keystone':
log_verbose => $verbose, log_verbose => $verbose,
@@ -53,13 +65,12 @@ class openstack::keystone (
# Setup the Keystone Identity Endpoint # Setup the Keystone Identity Endpoint
class { 'keystone::endpoint': class { 'keystone::endpoint':
public_address => $public_address, public_address => $public_address,
admin_address => $admin_address, admin_address => $real_admin_address,
internal_address => $internal_address, internal_address => $real_internal_address,
} }
# Configure the Keystone database # Configure the Keystone database
case $db_type { case $db_type {
'mysql': { 'mysql': {
class { 'keystone::config::mysql': class { 'keystone::config::mysql':
user => $keystone_db_user, user => $keystone_db_user,
@@ -68,7 +79,6 @@ class openstack::keystone (
dbname => $keystone_db_dbname, dbname => $keystone_db_dbname,
} }
} }
} }
} }

View File

@@ -7,47 +7,93 @@
# #
# See params.pp # See params.pp
# #
# === Examples
#
# class { 'openstack::nova::compute':
# internal_address => '192.168.2.2',
# vncproxy_host => '192.168.1.1',
# nova_user_password => 'changeme',
# }
class openstack::nova::compute ( class openstack::nova::compute (
# Network # Network
$public_address = $::openstack::params::public_address, $public_address = undef,
$private_interface = $::openstack::params::private_interface, $public_interface = 'eth0',
$public_interface = $::openstack::params::public_interface, $private_interface = 'eth1',
$fixed_range = $::openstack::params::fixed_range, $fixed_range = '10.0.0.0/24',
$network_manager = $::openstack::params::network_manager, $network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = $::openstack::params::network_config, $network_config = {},
$multi_host = $::openstack::params::multi_host, $multi_host = false,
# Virtualization # Virtualization
$libvirt_type = $::openstack::params::libvirt_type, $libvirt_type = 'kvm',
# Volumes # Volumes
$nova_volume = $::openstack::params::nova_volume, $nova_volume = 'nova-volumes',
$manage_volumes = $::openstack::params::manage_volume, $manage_volumes = true,
$iscsi_ip_address = $::openstack::params::iscsi_ip_address, $iscsi_ip_address = undef,
# VNC # VNC
$vnc_enabled = $::openstack::params::vnc_enabled, $vnc_enabled = true,
$vncserver_listen = $::openstack::params::vncserver_listen, $vncserver_listen = undef,
$vncserver_proxyclient_address = $::openstack::params::vncserver_proxyclient_address, $vncserver_proxyclient_address = undef,
$vncproxy_host = $::openstack::params::vncproxy_host, $vncproxy_host = undef,
# Nova
$nova_user_password = $::openstack::params::nova_user_password,
# General # General
$verbose = $::openstack::params::verbose, $verbose = false,
$exported_resources = $::openstack::params::exported_resources, $exported_resources = true,
$enabled = $::openstack::params::enabled $enabled = true,
# Required Network
$internal_address,
# Required Nova
$nova_user_password
) inherits openstack::params { ) 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 => $vncserver_proxyclient_address, vncserver_proxyclient_address => $real_vncserver_proxyclient_address,
vncproxy_host => $vncproxy_host, vncproxy_host => $real_vncproxy_host,
} }
# 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 => $vncserver_listen, vncserver_listen => $real_vncserver_listen,
} }
# if the compute node should be configured as a multi-host # if the compute node should be configured as a multi-host

View File

@@ -8,43 +8,71 @@
# #
# See params.pp # See params.pp
# #
# === Examples
#
# class { 'openstack::nova::controller':
# public_address => '192.168.1.1',
# db_host => '127.0.0.1',
# rabbit_password => 'changeme',
# nova_user_password => 'changeme',
# nova_db_password => 'changeme',
# }
#
class openstack::nova::controller ( class openstack::nova::controller (
# Network # Network
$network_manager = $::openstack::params::network_manager, $network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = $::openstack::params::network_config, $network_config = {},
$private_interface = $::openstack::params::private_interface, $public_interface = 'eth0',
$public_interface = $::openstack::params::public_interface, $private_interface = 'eth1',
$floating_range = $::openstack::params::floating_range, $fixed_range = '10.0.0.0/24',
$fixed_range = $::openstack::params::fixed_range, $floating_range = false,
$public_address = $::openstack::params::public_address, $admin_address = undef,
$admin_address = $::openstack::params::admin_address, $internal_address = undef,
$internal_address = $::openstack::params::internal_address, $auto_assign_floating_ip = false,
$auto_assign_floating_ip = $::openstack::params::auto_assign_floating_ip, $create_networks = true,
$create_networks = $::openstack::params::create_networks, $num_networks = 1,
$num_networks = $::openstack::params::num_networks, $multi_host = false,
$multi_host = $::openstack::params::multi_host,
# Nova # Nova
$nova_user_password = $::openstack::params::nova_user_password, $nova_db_user = 'nova',
$nova_db_user = $::openstack::params::nova_db_user, $nova_db_dbname = 'nova',
$nova_db_password = $::openstack::params::nova_db_password,
$nova_db_dbname = $::openstack::params::nova_db_dbname,
# Rabbit # Rabbit
$rabbit_user = $::openstack::params::rabbit_user, $rabbit_user = 'nova',
$rabbit_password = $::openstack::params::rabbit_password,
# Database # Database
$db_type = $::openstack::params::db_type, $db_type = 'mysql',
$db_host = $::openstack::params::db_host,
# Glance # Glance
$glance_api_servers = $::openstack::params::glance_api_servers, $glance_api_servers = undef,
# VNC # VNC
$vnc_enabled = $::openstack::params::vnc_enabled, $vnc_enabled = true,
# General # General
$verbose = $::openstack::params::verbose, $verbose = false,
$enabled = $::openstack::params::enabled, $enabled = true,
$exported_resources = $::openstack::params::exported_resources $exported_resources = true,
# Network Required
$public_address,
# Database Required
$db_host,
# Rabbit Required
$rabbit_password,
# Nova Required
$nova_user_password,
$nova_db_password,
) inherits openstack::params { ) 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
}
# Configure the db string # Configure the db string
case $db_type { case $db_type {
'mysql': { 'mysql': {
@@ -52,8 +80,11 @@ class openstack::nova::controller (
} }
} }
# Might need fixed if ($glance_api_servers == undef) {
# $glance_api_servers = "${internal_address}:9292" $real_glance_api_servers = "${public_address}:9292"
} else {
$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
@@ -63,7 +94,7 @@ class openstack::nova::controller (
@@nova_config { 'sql_connection': value => $nova_db } @@nova_config { 'sql_connection': value => $nova_db }
Nova_config <| title == 'sql_connection' |> Nova_config <| title == 'sql_connection' |>
@@nova_config { 'glance_api_servers': value => $glance_api_servers } @@nova_config { 'glance_api_servers': value => $real_glance_api_servers }
Nova_config <| title == 'glance_api_servers' |> Nova_config <| title == 'glance_api_servers' |>
@@nova_config { 'novncproxy_base_url': value => "http://${public_address}:6080/vnc_auto.html" } @@nova_config { 'novncproxy_base_url': value => "http://${public_address}:6080/vnc_auto.html" }
@@ -73,7 +104,7 @@ class openstack::nova::controller (
$rabbit_connection = false $rabbit_connection = false
} else { } else {
$sql_connection = $nova_db $sql_connection = $nova_db
$glance_connection = $glance_api_servers $glance_connection = $real_glance_api_servers
$rabbit_connection = $internal_address $rabbit_connection = $internal_address
} }
@@ -148,7 +179,6 @@ class openstack::nova::controller (
class { [ class { [
'nova::scheduler', 'nova::scheduler',
'nova::objectstore', 'nova::objectstore',
'nova::volume',
'nova::cert', 'nova::cert',
'nova::consoleauth' 'nova::consoleauth'
]: ]:

View File

@@ -1,362 +0,0 @@
#
# == Class: Parameters
#
# Convenient location to store default parameters.
# Able to be overridden in individual classes.
#
# === Parameters
#
# ==== General
#
# [enabled]
# - Whether services should be enabled. This parameter can be used to
# implement services in active-passive modes for HA. Optional.
# - Defaults to true.
#
# [verbose]
# - If the services should log verbosely. Optional.
# - Defaults to false.
#
# [exported_resources]
# - Whether or not to use exported resources
# - Defautlts to true
#
# ==== Network
#
# [public_address]
# - Public address used by vnchost. Optional.
# - Defaults to ipaddress_eth0
#
# [public_interface]
# - The interface used to route public traffic by the network service. Optional.
# - Defaults to eth0
#
# [private_interface]
# - The private interface used to bridge the VMs into a common network. Optional.
# - Defaults to eth1
#
# [internal_address]
# - Internal address used for management.
# - Defaults to ipaddress_eth1
#
# [public_address]
# [admin_address]
# - IP addresses for Keystone services
# - default: ipaddress_eth0
#
# [floating_range]
# - The floating ip range to be created. If it is false, then no floating ip range is created. Optional.
# - Defaults to false.
#
# [fixed_range]
# - The fixed private ip range to be created for the private VM network. Optional.
# - Defaults to '10.0.0.0/24'.
#
# [network_manager]
# - The network manager to use for the nova network service. Optional.
# - Defaults to 'nova.network.manager.FlatDHCPManager'.
#
# [iscsi_ip_address]
# - The IP address to use in the iscsi address
# - Defaults to $internal_address
#
# [auto_assign_floating_ip]
# - Rather configured to automatically allocate and assign a floating IP address to virtual instances when they are launched.
# - Defaults to false.
#
# [network_config]
# - Used to specify network manager specific parameters. Optional.
# - Defualts to {}.
#
# [create_networks]
# - Rather network and floating ips should be created.
# - Defaults to true
#
# [num_networks]
# - Number of networks that fixed range should be split into.
# - Defaults to 1
#
# [multi_host]
# - Node should support multi-host networking mode for HA.
# - Optional. Defaults to false.
#
#
# ==== Virtualization
#
# [libvirt_type]
# - The virualization type being controlled by libvirt. Optional.
# - Defaults to 'kvm'.
#
# ==== Volumes
#
# [nova_volume]
# - The name of the volume group to use for nova volume allocation. Optional.
# - Defaults to 'nova-volumes'.
#
# [manage_volumes]
# - Rather nova-volume should be enabled on this compute node.
# - Defaults to false.
#
# ==== Database
#
# [db_type]
# - which type of database to use
# - Defaults to 'mysql'
#
# [db_host]
# - where the db server is located
# - default: 127.0.0.1
#
# [sql_connection]
# - SQL connection information.
# - Defaults to false which indicates that exported resources will be used to determine connection information.
#
# ==== MySQL
#
# [mysql_root_password]
# - The root password to set for the mysql database. Optional.
# - Defaults to 'sql_pass'.
#
# [mysql_bind_address]
# - address for mysql to listen on
# - default: 0.0.0.0
#
# [mysql_account_security]
# - whether to secure the mysql installation
# - default: true
#
# [allowed_hosts]
# - array of hosts that can access the mysql server
# - default: ['127.0.0.1']
#
# ==== Rabbit
#
# [rabbit_password]
# - The password to use for the rabbitmq user. Optional.
# - Defaults to 'rabbit_pw'
#
# [rabbit_user]
# - The rabbitmq user to use for auth. Optional.
# - Defaults to 'nova'.
#
# [admin_email]
# - The admin's email address. Optional.
# - Defaults to 'root@localhost'
#
# [rabbit_host]
# - RabbitMQ host. False indicates it should be collected.
# - Defaults to false which indicates that exported resources will be used to determine connection information.
#
# ==== Keystone
#
# [keystone_db_user]
# - The name of the Keystone db user
# - Defaults to 'keystone'
#
# [keystone_db_password]
# - The default password for the keystone db user. Optional.
# - Defaults to 'keystone_pass'.
#
# [keystone_db_dbname]
# - The Keystone database name
# - Defaults to 'keystone'
#
# [keystone_admin_tenant]
# - The admin tenant name in Keystone
# - Defaults to 'admin'
#
# [keystone_admin_token]
# - The default auth token for keystone. Optional.
# - Defaults to 'keystone_admin_token'.
#
# [admin_email]
# - The email address for the Keystone admin user
# - Defaults to 'root@localhost'
#
# [admin_password]
# - The default password of the keystone admin. Optional.
# - Defaults to 'ChangeMe'.
#
# ==== Nova
#
# [nova_db_user]
# - The database user for Nova
# - Defaults to 'nova'
#
# [nova_db_password]
# - The nova db password. Optional.
# - Defaults to 'nova_pass'.
#
# [nova_user_password]
# - The password of the keystone user for the nova service. Optional.
# - Defaults to 'nova_pass'.
#
# [nova_db_dbname]
# - The database name for the Nova database
# - Defaults to 'nova'
#
# [purge_nova_config]
# - Whether unmanaged nova.conf entries should be purged. Optional.
# - Defaults to true.
#
# ==== Glance
#
# [glance_db_user]
# - The database user for Glance
# - Defaults to 'glance'
#
# [glance_db_password]
# - The password for the db user for glance. Optional.
# - Defaults to 'glance_pass'.
#
# [glance_user_password]
# - The password of the glance service user. Optional.
# - Defaults to 'glance_pass'.
#
# [glance_db_dbname]
# - The database name for the Glance database
# - Defaults to 'glance'
#
# [glance_api_servers]
# - List of glance api servers of the form HOST:PORT
# - Defaults to false which indicates that exported resources will be used to determine connection information.
#
# === Horizon related config - assumes puppetlabs-horizon code
#
# [secret_key]
# - secret key to encode cookies,
# - Defaults to 'dummy_secret_key'
#
# [cache_server_ip]
# - local memcached instance ip
# - Defaults to '127.0.0.1'
#
# [cache_server_port]
# - local memcached instance port
# - Defaults to '11211'
#
# [swift]
# - (bool) is swift installed
# - Defaults to false
#
# [quantum]
# - (bool) is quantum installed
# - Defaults to false
#
# [horizon_app_links]
# - array as in '[ ["Nagios","http://nagios_addr:port/path"],["Ganglia","http://ganglia_addr"] ]'
# - an array of arrays, that can be used to add call-out links to the dashboard for other apps.
# - There is no specific requirement for these apps to be for monitoring, that's just the defacto purpose.
# - Each app is defined in two parts, the display name, and the URI
# - Defaults to false
#
# === VNC
#
# [vnc_enabled]
# - Rather vnc console should be enabled.
# - Defaults to 'true',
#
# [vncserver_listen]
# - The address on the compute node where VNC should listen
# - Defaults to $internal_address
#
# [vncserver_proxyclient_address]
# - The address where the controller should contact the vnc server on the compute node
# - Defaults to $internal_address
#
# [vncproxy_host]
# - Host that serves as vnc proxy. This should be the public address of your controller.
# - Defaults to $public_address
#
class openstack::params {
# Generic
$enabled = true
$verbose = false
$exported_resources = true
# Network
$public_address = $::ipaddress_eth0
$public_interface = 'eth0'
$internal_address = $::ipaddress_eth1
$admin_address = $internal_address
$private_interface = 'eth2'
$fixed_range = '192.168.30.0/24'
$floating_range = false
$network_manager = 'nova.network.manager.FlatDHCPManager'
$iscsi_ip_address = $internal_address
$auto_assign_floating_ip = false
$network_config = {}
$create_networks = true
$num_networks = 1
$multi_host = false
# Virtualization
$libvirt_type = 'qemu'
# Volumes
$nova_volume = 'nova-volumes'
$manage_volumes = false
# Database
$db_type = 'mysql'
$db_host = $internal_address
$sql_connection = false
# MySQL params
$mysql_root_password = 'sql_pass'
$mysql_bind_address = '0.0.0.0'
$mysql_allowed_hosts = ['127.0.0.%', '10.0.0.%']
$mysql_account_security = true
# Rabbit params
$rabbit_password = 'rabbit_pw'
$rabbit_user = 'nova'
$rabbit_host = false
# Keystone params
$keystone_db_user = 'keystone'
$keystone_db_password = 'keystone_pass'
$keystone_db_dbname = 'keystone'
$keystone_admin_tenant = 'admin'
$keystone_admin_token = 'keystone_admin_token'
$admin_email = 'root@localhost'
$admin_password = 'ChangeMe'
# Glance params
$glance_db_user = 'glance'
$glance_db_password = 'glance_pass'
$glance_user_password = 'glance_pass'
$glance_db_dbname = 'glance'
$glance_api_servers = "${public_address}:9292"
# Nova params
$nova_db_user = 'nova'
$nova_db_password = 'nova_pass'
$nova_user_password = 'nova_pass'
$nova_db_dbname = 'nova'
$purge_nova_config = true
# Horizon params
$secret_key = 'dummy_secret_key'
$cache_server_ip = '127.0.0.1'
$cache_server_port = '11211'
$swift = false
$quantum = false
$horizon_app_links = undef
# vnc
$vnc_enabled = true
$vncserver_listen = $internal_address
$vncserver_proxyclient_address = $internal_address
$vncproxy_host = $public_address
# OS-specific params
case $::osfamily {
'Debian': {
}
'RedHat': {
}
}
}

View File

@@ -1 +1,15 @@
class { 'openstack::all': } class { 'openstack::all':
public_address => $::ipaddress_eth0,
mysql_root_password => 'password',
rabbit_password => 'password',
keystone_db_password => 'password',
keystone_admin_token => '12345',
admin_email => 'root@localhost',
admin_password => 'password',
nova_db_password => 'password',
nova_user_password => 'password',
glance_db_password => 'password',
glance_user_password => 'password',
libvirt_type => 'qemu',
secret_key => '12345',
}

View File

@@ -1 +1,16 @@
class { 'openstack::controller': } class { 'openstack::controller':
public_address => $::ipaddress_eth0,
mysql_root_password => 'password',
allowed_hosts => ['127.0.0.%', '192.168.1.%'],
rabbit_password => 'password',
keystone_db_password => 'password',
keystone_admin_token => '12345',
admin_email => 'root@localhost',
admin_password => 'password',
nova_db_password => 'password',
nova_user_password => 'password',
glance_db_password => 'password',
glance_user_password => 'password',
secret_key => '12345',
exported_resources => false,
}

View File

@@ -1,4 +1,10 @@
class { 'openstack::compute': class { 'openstack::compute':
exported_resources => false,
sql_connection => 'mysql://foo:bar@192.168.1.1/nova', sql_connection => 'mysql://foo:bar@192.168.1.1/nova',
glance_api_servers => '192.168.1.1:9292', glance_api_servers => '192.168.1.1:9292',
internal_address => $::ipaddress_eth1,
rabbit_password => 'password',
nova_user_password => 'password',
libvirt_type => 'qemu',
vncproxy_host => '192.168.1.1',
} }