Pacemaker: allow to manage nova-api
As an option and disabled by default, allow to manage nova-api with Pacemaker for high-availability. Change-Id: I7e6b909a7d5e4fdc00b9f799d2066f8eb1c7ac6a
This commit is contained in:
parent
3d0a38f973
commit
444fd65eb8
@ -57,6 +57,10 @@
|
||||
# Should be an hash.
|
||||
# Default to {}
|
||||
#
|
||||
# [*pacemaker_enabled*]
|
||||
# (optional) Manage Nova API with Pacemaker or not.
|
||||
# Default to false
|
||||
#
|
||||
class cloud::compute::api(
|
||||
$ks_keystone_internal_host = '127.0.0.1',
|
||||
$ks_keystone_internal_proto = 'http',
|
||||
@ -67,9 +71,12 @@ class cloud::compute::api(
|
||||
$ks_ec2_public_port = '8773',
|
||||
$ks_metadata_public_port = '8775',
|
||||
$firewall_settings = {},
|
||||
$pacemaker_enabled = false,
|
||||
){
|
||||
|
||||
include 'cloud::compute'
|
||||
include cloud::compute
|
||||
include cloud::params
|
||||
include nova::params
|
||||
|
||||
class { 'nova::api':
|
||||
enabled => true,
|
||||
@ -82,6 +89,14 @@ class cloud::compute::api(
|
||||
osapi_v3 => true,
|
||||
}
|
||||
|
||||
if $pacemaker_enabled {
|
||||
cloud::clustering::pacemaker_service { $::nova::params::api_service_name:
|
||||
service_name => $::nova::params::api_service_name,
|
||||
primitive_class => $::cloud::params::service_provider,
|
||||
requires => Package[$::nova::params::api_package_name],
|
||||
}
|
||||
}
|
||||
|
||||
if $::cloud::manage_firewall {
|
||||
cloud::firewall::rule{ '100 allow nova-api access':
|
||||
port => $ks_nova_public_port,
|
||||
|
@ -48,6 +48,7 @@ class cloud::params {
|
||||
$keepalived_vrrp_script = 'systemctl status haproxy.service'
|
||||
$puppetmaster_package_name = 'puppet-server'
|
||||
$redis_service_name = 'redis'
|
||||
$service_provider = 'systemd'
|
||||
} # RedHat
|
||||
'Debian': {
|
||||
# Specific to Debian / Ubuntu
|
||||
@ -60,9 +61,11 @@ class cloud::params {
|
||||
case $::operatingsystem {
|
||||
'Ubuntu': {
|
||||
$libvirt_service_name = 'libvirt-bin'
|
||||
$service_provider = 'upstart'
|
||||
}
|
||||
default: {
|
||||
$libvirt_service_name = 'libvirtd'
|
||||
$service_provider = 'lsb'
|
||||
}
|
||||
}
|
||||
} # Debian
|
||||
|
@ -121,7 +121,8 @@ describe 'cloud::compute::api' do
|
||||
:api_bind_address => '127.0.0.1',
|
||||
:metadata_listen => '127.0.0.1',
|
||||
:neutron_metadata_proxy_shared_secret => 'metadatapassword',
|
||||
:osapi_v3 => true
|
||||
:osapi_v3 => true,
|
||||
:manage_service => true,
|
||||
)
|
||||
end
|
||||
|
||||
@ -129,6 +130,25 @@ describe 'cloud::compute::api' do
|
||||
is_expected.to contain_class('nova::cron::archive_deleted_rows')
|
||||
end
|
||||
|
||||
context 'when pacemaker manages nova-api' do
|
||||
before :each do
|
||||
params.merge!( :pacemaker_enabled => true )
|
||||
end
|
||||
it 'configure nova-api without managing the service' do
|
||||
is_expected.to contain_class('nova::api').with(
|
||||
:manage_service => true,
|
||||
)
|
||||
end
|
||||
it 'should create a Pacemaker service for nova-api' do
|
||||
should contain_openstack_extras__pacemaker__service(platform_params[:api_service_name]).with(
|
||||
{
|
||||
'ensure' => :present,
|
||||
'primitive_class' => platform_params[:service_provider],
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with default firewall enabled' do
|
||||
let :pre_condition do
|
||||
"class { 'cloud': manage_firewall => true }"
|
||||
@ -185,7 +205,14 @@ describe 'cloud::compute::api' do
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
{ :osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian' }
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :service_provider => 'lsb',
|
||||
:api_service_name => 'nova-api',
|
||||
}
|
||||
end
|
||||
|
||||
it_configures 'openstack compute api'
|
||||
@ -195,6 +222,13 @@ describe 'cloud::compute::api' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :service_provider => 'systemd',
|
||||
:api_service_name => 'openstack-nova-api',
|
||||
}
|
||||
end
|
||||
|
||||
it_configures 'openstack compute api'
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user