Split out compute from controller
- split compute::libvirt from compute - moved network_manager and flat interface to nova class b/c they are shared by multiple components - added compute::libvirt
This commit is contained in:
@@ -4,15 +4,12 @@ class nova::compute(
|
|||||||
$api_server,
|
$api_server,
|
||||||
$enabled = false,
|
$enabled = false,
|
||||||
$api_port = 8773,
|
$api_port = 8773,
|
||||||
$aws_address = '169.254.169.254',
|
$aws_address = '169.254.169.254'
|
||||||
$libvirt_type = 'kvm'
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
Exec['post-nova_config'] ~> Service['nova-compute']
|
Exec['post-nova_config'] ~> Service['nova-compute']
|
||||||
Exec['nova-db-sync'] ~> Service['nova-compute']
|
Exec['nova-db-sync'] ~> Service['nova-compute']
|
||||||
|
|
||||||
nova_config { 'libvirt_type': value => $libvirt_type }
|
|
||||||
|
|
||||||
if $enabled {
|
if $enabled {
|
||||||
$service_ensure = 'running'
|
$service_ensure = 'running'
|
||||||
} else {
|
} else {
|
||||||
|
12
manifests/compute/libvirt.pp
Normal file
12
manifests/compute/libvirt.pp
Normal file
@@ -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,
|
||||||
|
}
|
||||||
|
}
|
@@ -5,10 +5,7 @@ class nova::compute::xenserver(
|
|||||||
$xenapi_connection_url,
|
$xenapi_connection_url,
|
||||||
$xenapi_connection_username,
|
$xenapi_connection_username,
|
||||||
$xenapi_connection_password,
|
$xenapi_connection_password,
|
||||||
$xenapi_inject_image=false,
|
$xenapi_inject_image=false
|
||||||
$network_manager='nova.network.manager.FlatManager',
|
|
||||||
$flat_network_bridge='xenbr0',
|
|
||||||
$enabled=true
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
class { 'nova::compute':
|
class { 'nova::compute':
|
||||||
|
@@ -14,7 +14,8 @@ class nova(
|
|||||||
$rabbit_port='5672',
|
$rabbit_port='5672',
|
||||||
$rabbit_userid='guest',
|
$rabbit_userid='guest',
|
||||||
$rabbit_virtual_host='/',
|
$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,
|
$service_down_time = 60,
|
||||||
$logdir = '/var/log/nova',
|
$logdir = '/var/log/nova',
|
||||||
$state_path = '/var/lib/nova',
|
$state_path = '/var/lib/nova',
|
||||||
@@ -98,6 +99,11 @@ class nova(
|
|||||||
'state_path': value => $state_path;
|
'state_path': value => $state_path;
|
||||||
'lock_path': value => $lock_path;
|
'lock_path': value => $lock_path;
|
||||||
'service_down_time': value => $service_down_time;
|
'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;
|
||||||
|
'flat_network_bridge': value => $flat_network_bridge;
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'post-nova_config':
|
exec { 'post-nova_config':
|
||||||
|
@@ -11,11 +11,6 @@ class nova::network::flat (
|
|||||||
enabled => $enabled,
|
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.
|
# flatManager requires a network bridge be manually setup.
|
||||||
if $configure_bridge {
|
if $configure_bridge {
|
||||||
nova::network::bridge { $flat_network_bridge:
|
nova::network::bridge { $flat_network_bridge:
|
||||||
|
@@ -14,7 +14,6 @@ class nova::network::flatdhcp (
|
|||||||
}
|
}
|
||||||
|
|
||||||
nova_config {
|
nova_config {
|
||||||
'network_manage': value => 'nova.network.manager.FlatDHCPManager';
|
|
||||||
'public_interface': value => $public_interface;
|
'public_interface': value => $public_interface;
|
||||||
'flat_interface': value => $flat_interface;
|
'flat_interface': value => $flat_interface;
|
||||||
'flat_dhcp_start': value => $flat_dhcp_start;
|
'flat_dhcp_start': value => $flat_dhcp_start;
|
||||||
|
2
tests/compute/libvirt.pp
Normal file
2
tests/compute/libvirt.pp
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
$libvirt_hash = { 'nova::compute::libvirt' => {} }
|
||||||
|
create_resources( 'class', $libvirt_hash)
|
Reference in New Issue
Block a user