Add Quantum API configuration

This commit is contained in:
Florian Haas 2013-07-08 15:06:11 +00:00
parent 68a08fedd0
commit 6764986b46
4 changed files with 87 additions and 0 deletions

View File

@ -38,6 +38,8 @@ class kickstack (
$cinder_lvm_vg = $kickstack::params::cinder_lvm_vg,
$cinder_rbd_pool = $kickstack::params::cinder_rbd_pool,
$cinder_rbd_user = $kickstack::params::cinder_rbd_user,
$quantum_network_type = $kickstack::params::quantum_network_type,
$quantum_plugin = $kickstack::params::quantum_plugin,
) inherits kickstack::params {
include exportfact

View File

@ -90,4 +90,18 @@ class kickstack::params {
# The RADOS user to use for volumes. Ignored unless $cinder_backend==rbd.
$cinder_rbd_user = pick(getvar("::${variable_prefix}cinder_rbd_pool"),"cinder")
# The network type to configure for Quantum.
# See http://docs.openstack.org/grizzly/openstack-network/admin/content/use_cases.html
# Supported:
# single-flat (default)
# provider-router
# per-tenant-router
$quantum_network_type = pick(getvar("::${variable_prefix}quantum_network_type"),"single-flat")
# The plugin to use with Quantum.
# Supported:
# linuxbridge
# ovs (default)
$quantum_plugin = pick(getvar("::${variable_prefix}quantum_plugin"),"ovs")
}

View File

@ -0,0 +1,56 @@
class kickstack::quantum::config inherits kickstack {
$allow_overlapping_ips = "$::kickstack::quantum_network_type" ? {
'single-flat' => false,
'provider-router' => false,
'per-tenant-router' => true,
}
$core_plugin = "$::kickstack::quantum_plugin" ? {
'ovs' => 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
'linuxbridge'=> 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2'
}
case "$::kickstack::rpc" {
"rabbitmq": {
$rabbit_host = getvar("${fact_prefix}rabbit_host")
$rabbit_password = getvar("${fact_prefix}rabbit_password")
if $rabbit_host and $rabbit_password {
class { 'quantum':
rpc_backend => 'quantum.openstack.common.rpc.impl_kombu',
rabbit_host => "$rabbit_host",
rabbit_virtual_host => "$::kickstack::rabbit_virtual_host",
rabbit_user => "$::kickstack::rabbit_userid",
rabbit_password => $rabbit_password,
verbose => $::kickstack::verbose,
debug => $::kickstack::debug,
allow_overlapping_ips => $allow_overlapping_ips,
core_plugin => $core_plugin,
}
}
else {
warning("Facts ${fact_prefix}rabbit_host or ${fact_prefix}rabbit_password unset, cannot configure quantum")
}
}
"qpid": {
$qpid_hostname = getvar("${fact_prefix}qpid_hostname")
$qpid_password = getvar("${fact_prefix}rabbit_password")
if $qpid_hostname and $qpid_password {
class { 'quantum':
rpc_backend => 'quantum.openstack.common.rpc.impl_qpid',
qpid_hostname => "$qpid_hostname",
qpid_realm => "$::kickstack::qpid_realm",
qpid_username => "$::kickstack::qpid_username",
qpid_password => $qpid_password,
verbose => $::kickstack::verbose,
debug => $::kickstack::debug,
allow_overlapping_ips => $allow_overlapping_ips,
core_plugin => $core_plugin,
}
}
else {
warning("Facts ${fact_prefix}qpid_hostname or ${fact_prefix}qpid_password unset, cannot configure quantum")
}
}
}
}

View File

@ -0,0 +1,15 @@
class kickstack::quantum::server inherits kickstack {
include kickstack::quantum::config
$service_password = getvar("${fact_prefix}quantum_keystone_password")
$keystone_internal_address = getvar("${fact_prefix}keystone_internal_address")
class { '::quantum::server':
auth_tenant => $kickstack::keystone_service_tenant,
auth_user => 'quantum',
auth_password => $service_password,
auth_host => $keystone_internal_address
}
}