Files
puppet-openstack/manifests/compute.pp
Dan Bode 6c6439a459 Add LICENSE and inline documentation.
This commit adds an apache license and inline documentation for the
manifest.
2012-05-10 22:18:33 -07:00

125 lines
4.3 KiB
Puppet

#
# This class is intended to serve as
# a way of deploying compute nodes.
#
# This currently makes the following assumptions:
# - libvirt is used to manage the hypervisors
# - flatdhcp networking is used
# - glance is used as the backend for the image service
#
# TODO - I need to make the choise of networking configurable
#
#
# [private_interface] Interface used for vm networking connectivity. Required.
# [internal_address] Internal address used for management. Required.
# [public_interface] Public interface used to route public traffic. Optional.
# Defaults to false.
# [fixed_range] Range of ipv4 network for vms.
# [network_manager] Nova network manager to use.
# [multi_host] Rather node should support multi-host networking mode for HA.
# Optional. Defaults to false.
# [network_config] Hash that can be used to pass implementation specifc
# network settings. Optioal. Defaults to {}
# [sql_connection] SQL connection information. Optional. Defaults to false
# which indicates that exported resources will be used to determine connection
# information.
# [rabbit_host] RabbitMQ host. False indicates it should be collected.
# Optional. Defaults to false,
# [rabbit_password] RabbitMQ password. Optional. Defaults to 'rabbit_pw',
# [rabbit_user] RabbitMQ user. Optional. Defaults to 'nova',
# [glance_api_servers] List of glance api servers of the form HOST:PORT
# delimited by ':'. False indicates that the resource should be collected.
# Optional. Defaults to false,
# [libvirt_type] Underlying libvirt supported hypervisor.
# Optional. Defaults to 'kvm',
# [vncproxy_host] Host that serves as vnc proxy. Optional.
# Defaults to false. False indicates that a vnc proxy should not be configured.
# [vnc_enabled] Rather vnc console should be enabled.
# Optional. Defaults to 'true',
# [verbose] Rather components should log verbosely.
# Optional. Defaults to false.
#
class openstack::compute(
$private_interface,
$internal_address,
# networking config
$public_interface = undef,
$fixed_range = '10.0.0.0/16',
$network_manager = 'nova.network.manager.FlatDHCPManager',
$multi_host = false,
$network_config = {},
# my address
# conection information
$sql_connection = false,
$rabbit_host = false,
$rabbit_password = 'rabbit_pw',
$rabbit_user = 'nova',
$glance_api_servers = false,
# nova compute configuration parameters
$libvirt_type = 'kvm',
$vncproxy_host = false,
$vnc_enabled = 'true',
$verbose = false
) {
class { 'nova':
sql_connection => $sql_connection,
rabbit_host => $rabbit_host,
rabbit_userid => $rabbit_user,
rabbit_password => $rabbit_password,
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_api_servers,
verbose => $verbose,
}
class { 'nova::compute':
enabled => true,
vnc_enabled => $vnc_enabled,
vncserver_proxyclient_address => $internal_address,
vncproxy_host => $vncproxy_host,
}
class { 'nova::compute::libvirt':
libvirt_type => $libvirt_type,
vncserver_listen => $internal_address,
}
# if the compute node should be configured as a multi-host
# compute installation
if $multi_host {
include keystone::python
nova_config { 'multi_host': value => 'True'; }
if ! $public_interface {
fail('public_interface must be defined for multi host compute nodes')
}
$enable_network_service = true
class { 'nova::api':
enabled => true,
admin_tenant_name => 'services',
admin_user => 'nova',
admin_password => $nova_service_password,
}
} else {
$enable_network_service = false
nova_config {
'multi_host': value => 'False';
}
}
# set up configuration for networking
class { 'nova::network':
private_interface => $private_interface,
public_interface => $public_interface,
fixed_range => $fixed_range,
floating_range => false,
network_manager => $network_manager,
config_overrides => $network_config,
create_networks => false,
enabled => $enable_network_service,
install_service => $enable_network_service,
}
}