re-add nova-network support

This commit adds nova network support for
openstack::compute, openstack::controller, and
openstack::nova::controller.
This commit is contained in:
Joe Topjian
2012-10-24 11:02:31 -07:00
committed by Dan Bode
parent 7bba3d59a0
commit 69e48a2ed2
3 changed files with 72 additions and 47 deletions

View File

@@ -22,9 +22,18 @@ class openstack::compute (
$nova_user_password,
# Required Rabbit
$rabbit_password,
# Network
# DB
$sql_connection = false,
# Network
$quantum = true,
$public_address = $internal_address,
$admin_address = $internal_address,
$public_interface = undef,
$private_interface = undef,
$fixed_range = undef,
$network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = {},
$multi_host = false,
# Nova
$purge_nova_config = true,
# Rabbit
@@ -84,41 +93,46 @@ class openstack::compute (
# 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';
# 'send_arp_for_ha': 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_user_password,
# TODO override enabled_apis
if $quantum == false {
if $multi_host {
include keystone::python
nova_config {
'multi_host': value => 'True';
'send_arp_for_ha': 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_user_password,
# TODO override enabled_apis
}
} else {
$enable_network_service = false
nova_config {
'multi_host': value => 'False';
'send_arp_for_ha': value => 'False';
}
}
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,
}
} else {
#$enable_network_service = false
#nova_config {
# 'multi_host': value => 'False';
# 'send_arp_for_ha': value => 'False';
#}
# TODO install quantum
}
#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,
#}
}

View File

@@ -83,6 +83,7 @@ class openstack::controller (
# Required Horizon
$secret_key = 'dummy_secret_key',
# not sure if this works correctly
# Network
$internal_address = $public_address,
$admin_address = $public_address,
$network_manager = 'nova.network.manager.FlatDHCPManager',
@@ -111,6 +112,7 @@ class openstack::controller (
$nova_db_user = 'nova',
$nova_db_dbname = 'nova',
$purge_nova_config = true,
$quantum = true,
# Rabbit
$rabbit_password = 'rabbit_pw',
$rabbit_user = 'nova',
@@ -228,6 +230,7 @@ class openstack::controller (
db_host => $db_host,
# Network
network_manager => $network_manager,
network_config => $network_config,
floating_range => $floating_range,
fixed_range => $fixed_range,
public_address => $public_address,
@@ -237,6 +240,8 @@ class openstack::controller (
create_networks => $create_networks,
num_networks => $num_networks,
multi_host => $multi_host,
public_interface => $public_interface,
private_interface => $private_interface,
quantum => $quantum,
# Nova
nova_user_password => $nova_user_password,

View File

@@ -30,15 +30,18 @@ class openstack::nova::controller (
$nova_user_password,
$nova_db_password,
# Network
$fixed_range = '10.0.0.0/24',
$network_manager = 'nova.network.manager.FlatDHCPManager',
$network_config = {},
$floating_range = false,
$internal_address = $public_address,
$fixed_range = '10.0.0.0/24',
$admin_address = $public_address,
$internal_address = $public_address,
$auto_assign_floating_ip = false,
$create_networks = true,
$num_networks = 1,
$multi_host = false,
$network_manager = 'nova.network.manager.FlatDHCPManager',
$public_interface = undef,
$private_interface = undef,
$quantum = true,
# Nova
$nova_db_user = 'nova',
@@ -115,17 +118,6 @@ class openstack::nova::controller (
auth_host => $keystone_host,
}
# Configure nova-network
if $multi_host {
nova_config { 'multi_host': value => 'True' }
$enable_network_service = false
} else {
if $enabled {
$enable_network_service = true
} else {
$enable_network_service = false
}
}
if $enabled {
$really_create_networks = $create_networks
@@ -134,6 +126,18 @@ class openstack::nova::controller (
}
if $quantum == false {
# Configure nova-network
if $multi_host {
nova_config { 'multi_host': value => 'True' }
$enable_network_service = false
} else {
if $enabled {
$enable_network_service = true
} else {
$enable_network_service = false
}
}
class { 'nova::network':
private_interface => $private_interface,
public_interface => $public_interface,
@@ -146,6 +150,8 @@ class openstack::nova::controller (
enabled => $enable_network_service,
install_service => $enable_network_service,
}
} else {
# Set up Quantum
}
if $auto_assign_floating_ip {