commit
71c65b66c0
|
@ -12,7 +12,7 @@ class nova::all(
|
|||
$rabbit_virtual_host = undef,
|
||||
$rabbit_host = undef,
|
||||
|
||||
$libvirt_type = 'qemu',
|
||||
$libvirt_type = 'kvm',
|
||||
|
||||
$flat_network_bridge = 'br100',
|
||||
$flat_network_bridge_ip = '11.0.0.1',
|
||||
|
@ -23,6 +23,8 @@ class nova::all(
|
|||
|
||||
$image_service = 'nova.image.glance.GlanceImageService',
|
||||
$glance_api_servers = 'localhost:9292',
|
||||
$glance_host = 'localhost',
|
||||
$glance_port = '9292',
|
||||
|
||||
$admin_user = 'novaadmin',
|
||||
$project_name = 'nova',
|
||||
|
@ -31,17 +33,11 @@ class nova::all(
|
|||
) {
|
||||
|
||||
|
||||
# work around hostname bug, LP #653405
|
||||
host { $hostname:
|
||||
ip => $ipaddress,
|
||||
host_aliases => $fqdn,
|
||||
}
|
||||
class { 'nova::rabbitmq':
|
||||
port => $rabbit_port,
|
||||
userid => $rabbit_userid,
|
||||
password => $rabbit_password,
|
||||
virtual_host => $rabbit_virtual_host,
|
||||
require => Host[$hostname],
|
||||
}
|
||||
|
||||
class { "nova":
|
||||
|
@ -49,6 +45,8 @@ class nova::all(
|
|||
sql_connection => "mysql://${db_user}:${db_password}@${db_host}/${db_name}",
|
||||
image_service => $image_service,
|
||||
glance_api_servers => $glance_api_servers,
|
||||
glance_host => $glance_host,
|
||||
glance_port => $glance_port,
|
||||
rabbit_host => $rabbit_host,
|
||||
rabbit_port => $rabbit_port,
|
||||
rabbit_userid => $rabbit_userid,
|
||||
|
@ -60,15 +58,21 @@ class nova::all(
|
|||
|
||||
class { "nova::compute":
|
||||
api_server => $ipaddress,
|
||||
libvirt_type => $libvirt_type,
|
||||
enabled => true,
|
||||
}
|
||||
class { 'nova::compute::libvirt':
|
||||
libvirt_type => $libvirt_type,
|
||||
flat_network_bridge => $flat_network_bridge,
|
||||
flat_network_bridge_ip => $flat_network_bridge_ip,
|
||||
flat_network_bridge_netmask => $flat_network_bridge_netmask,
|
||||
}
|
||||
|
||||
class { "nova::network::flat":
|
||||
enabled => true,
|
||||
flat_network_bridge => $flat_network_bridge,
|
||||
flat_network_bridge_ip => $flat_network_bridge_ip,
|
||||
flat_network_bridge_netmask => $flat_network_bridge_netmask,
|
||||
configure_bridge => false,
|
||||
}
|
||||
|
||||
class { "nova::objectstore": enabled => true }
|
||||
|
|
|
@ -4,15 +4,12 @@ class nova::compute(
|
|||
$api_server,
|
||||
$enabled = false,
|
||||
$api_port = 8773,
|
||||
$aws_address = '169.254.169.254',
|
||||
$libvirt_type = 'kvm'
|
||||
$aws_address = '169.254.169.254'
|
||||
) {
|
||||
|
||||
Exec['post-nova_config'] ~> Service['nova-compute']
|
||||
Exec['nova-db-sync'] ~> Service['nova-compute']
|
||||
|
||||
nova_config { 'libvirt_type': value => $libvirt_type }
|
||||
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
|
@ -32,9 +29,9 @@ class nova::compute(
|
|||
}
|
||||
|
||||
# forward guest metadata requests to correct API server
|
||||
exec { "forward_api_requests":
|
||||
command => "/sbin/iptables -t nat -A PREROUTING -d ${aws_address}/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination ${api_server}:${api_port}",
|
||||
unless => "/sbin/iptables -L PREROUTING -t nat -n | egrep 'DNAT[ ]+tcp+[ ]+--[ ]+0.0.0.0\\/0+[ ]+${aws_address}+[ ]+tcp+[ ]+dpt:80+[ ]+to:${api_server}:${api_port}'"
|
||||
}
|
||||
|
||||
# exec { "forward_api_requests":
|
||||
# command => "/sbin/iptables -t nat -A PREROUTING -d ${aws_address}/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination ${api_server}:${api_port}",
|
||||
# unless => "/sbin/iptables -L PREROUTING -t nat -n | egrep 'DNAT[ ]+tcp+[ ]+--[ ]+0.0.0.0\\/0+[ ]+${aws_address}+[ ]+tcp+[ ]+dpt:80+[ ]+to:${api_server}:${api_port}'",
|
||||
# logoutput => on_failure
|
||||
# }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
class nova::compute::libvirt (
|
||||
$libvirt_type = 'kvm',
|
||||
$flat_network_bridge = 'br100',
|
||||
$flat_network_bridge_ip,
|
||||
$flat_network_bridge_netmask
|
||||
) {
|
||||
nova_config { 'libvirt_type': value => $libvirt_type }
|
||||
nova::network::bridge { $flat_network_bridge:
|
||||
ip => $flat_network_bridge_ip,
|
||||
netmask => $flat_network_bridge_netmask,
|
||||
}
|
||||
}
|
|
@ -1,29 +1,18 @@
|
|||
class nova::compute::xenserver(
|
||||
# TODO - what does this host do?
|
||||
$host,
|
||||
$api_server,
|
||||
$xenapi_connection_url,
|
||||
$xenapi_connection_username,
|
||||
$xenapi_connection_password,
|
||||
$xenapi_inject_image=false,
|
||||
$network_manager='nova.network.manager.FlatManager',
|
||||
$flat_network_bridge='xenbr0',
|
||||
$enabled=true
|
||||
$xenapi_inject_image=false
|
||||
) {
|
||||
|
||||
class { 'nova::compute':
|
||||
api_server => $api_server,
|
||||
enabled => $enabled,
|
||||
}
|
||||
nova_config {
|
||||
'connection_type': value => 'xenapi';
|
||||
'xenapi_connection_url': value => $xenapi_connection_url;
|
||||
'xenapi_connection_username': value => $xenapi_connection_username;
|
||||
'xenapi_connection_password': value => $xenapi_connection_password;
|
||||
'xenapi_inject_image': value => $xenapi_inject_image;
|
||||
'network_manager': value => $network_manager;
|
||||
'flat_network_bridge': value => $flat_network_bridge;
|
||||
}
|
||||
|
||||
package { 'xenapi':
|
||||
ensure => installed,
|
||||
provider => pip
|
||||
|
|
|
@ -49,12 +49,6 @@ class nova::controller(
|
|||
|
||||
class { "nova::api": enabled => true }
|
||||
|
||||
class { "nova::compute":
|
||||
api_server => $ipaddress,
|
||||
libvirt_type => $libvirt_type,
|
||||
enabled => true,
|
||||
}
|
||||
|
||||
class { "nova::network::flat":
|
||||
enabled => true,
|
||||
flat_network_bridge => $flat_network_bridge,
|
||||
|
|
|
@ -14,7 +14,8 @@ class nova(
|
|||
$rabbit_port='5672',
|
||||
$rabbit_userid='guest',
|
||||
$rabbit_virtual_host='/',
|
||||
# Following may need to be broken out to different nova services
|
||||
$network_manager = 'nova.network.manager.FlatManager',
|
||||
$flat_network_bridge = 'br100',
|
||||
$service_down_time = 60,
|
||||
$logdir = '/var/log/nova',
|
||||
$state_path = '/var/lib/nova',
|
||||
|
@ -98,6 +99,10 @@ class nova(
|
|||
'state_path': value => $state_path;
|
||||
'lock_path': value => $lock_path;
|
||||
'service_down_time': value => $service_down_time;
|
||||
# These network entries wound up in the common
|
||||
# config b/c they have to be set by both compute
|
||||
# as well as controller.
|
||||
'network_manager': value => $network_manager;
|
||||
}
|
||||
|
||||
exec { 'post-nova_config':
|
||||
|
@ -105,6 +110,12 @@ class nova(
|
|||
refreshonly => true,
|
||||
}
|
||||
|
||||
if $network_manager == 'nova.network.manager.FlatManager' {
|
||||
nova_config {
|
||||
'flat_network_bridge': value => $flat_network_bridge
|
||||
}
|
||||
}
|
||||
|
||||
if $image_service == 'nova.image.glance.GlanceImageService' {
|
||||
nova_config {
|
||||
'glance_api_servers': value => $glance_api_servers;
|
||||
|
|
|
@ -11,11 +11,6 @@ class nova::network::flat (
|
|||
enabled => $enabled,
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'network_manager': value => 'nova.network.manager.FlatManager';
|
||||
'flat_network_bridge': value => $flat_network_bridge;
|
||||
}
|
||||
|
||||
# flatManager requires a network bridge be manually setup.
|
||||
if $configure_bridge {
|
||||
nova::network::bridge { $flat_network_bridge:
|
||||
|
|
|
@ -14,7 +14,6 @@ class nova::network::flatdhcp (
|
|||
}
|
||||
|
||||
nova_config {
|
||||
'network_manage': value => 'nova.network.manager.FlatDHCPManager';
|
||||
'public_interface': value => $public_interface;
|
||||
'flat_interface': value => $flat_interface;
|
||||
'flat_dhcp_start': value => $flat_dhcp_start;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
$libvirt_hash = { 'nova::compute::libvirt' => {} }
|
||||
create_resources( 'class', $libvirt_hash)
|
Loading…
Reference in New Issue