Stop overriding service provider
Stop overriding service providers and let Puppet finds the best, depending of the distro where Puppet is run. Change-Id: Ic06ffc377f8982337d977bebb96ef7f6196e5c22
This commit is contained in:
@@ -155,10 +155,9 @@ class nova::compute::libvirt (
|
|||||||
|
|
||||||
if($::osfamily == 'RedHat' and $::operatingsystem != 'Fedora') {
|
if($::osfamily == 'RedHat' and $::operatingsystem != 'Fedora') {
|
||||||
service { 'messagebus':
|
service { 'messagebus':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
name => $::nova::params::messagebus_service_name,
|
name => $::nova::params::messagebus_service_name,
|
||||||
provider => $::nova::params::special_service_provider,
|
|
||||||
}
|
}
|
||||||
Package['libvirt'] -> Service['messagebus'] -> Service['libvirt']
|
Package['libvirt'] -> Service['messagebus'] -> Service['libvirt']
|
||||||
}
|
}
|
||||||
@@ -197,30 +196,27 @@ class nova::compute::libvirt (
|
|||||||
}
|
}
|
||||||
|
|
||||||
service { 'libvirt' :
|
service { 'libvirt' :
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
name => $libvirt_service_name,
|
name => $libvirt_service_name,
|
||||||
provider => $::nova::params::special_service_provider,
|
require => Package['libvirt'],
|
||||||
require => Package['libvirt'],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if $virtlock_service_name {
|
if $virtlock_service_name {
|
||||||
service { 'virtlockd':
|
service { 'virtlockd':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
name => $virtlock_service_name,
|
name => $virtlock_service_name,
|
||||||
provider => $::nova::params::special_service_provider,
|
require => Package['libvirt']
|
||||||
require => Package['libvirt']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $virtlog_service_name {
|
if $virtlog_service_name {
|
||||||
service { 'virtlogd':
|
service { 'virtlogd':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
name => $virtlog_service_name,
|
name => $virtlog_service_name,
|
||||||
provider => $::nova::params::special_service_provider,
|
require => Package['libvirt']
|
||||||
require => Package['libvirt']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,20 +52,16 @@ class nova::params {
|
|||||||
$nova_wsgi_script_path = '/var/www/cgi-bin/nova'
|
$nova_wsgi_script_path = '/var/www/cgi-bin/nova'
|
||||||
$nova_api_wsgi_script_source = '/usr/lib/python2.7/site-packages/nova/wsgi/nova-api.py'
|
$nova_api_wsgi_script_source = '/usr/lib/python2.7/site-packages/nova/wsgi/nova-api.py'
|
||||||
case $::operatingsystem {
|
case $::operatingsystem {
|
||||||
'Fedora': {
|
|
||||||
$special_service_provider = undef
|
|
||||||
}
|
|
||||||
'RedHat', 'CentOS', 'Scientific', 'OracleLinux': {
|
'RedHat', 'CentOS', 'Scientific', 'OracleLinux': {
|
||||||
if (versioncmp($::operatingsystemmajrelease, '7') < 0) {
|
if (versioncmp($::operatingsystemmajrelease, '7') < 0) {
|
||||||
$messagebus_service_name = 'messagebus'
|
$messagebus_service_name = 'messagebus'
|
||||||
$special_service_provider = 'init'
|
|
||||||
} else {
|
} else {
|
||||||
$messagebus_service_name = 'dbus'
|
$messagebus_service_name = 'dbus'
|
||||||
$special_service_provider = 'redhat'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
$special_service_provider = 'init'
|
# not packaged on Fedora
|
||||||
|
$messagebus_service_name = undef
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,8 +108,6 @@ class nova::params {
|
|||||||
$spicehtml5proxy_package_name = 'nova-consoleproxy'
|
$spicehtml5proxy_package_name = 'nova-consoleproxy'
|
||||||
$spicehtml5proxy_service_name = 'nova-spicehtml5proxy'
|
$spicehtml5proxy_service_name = 'nova-spicehtml5proxy'
|
||||||
$vncproxy_package_name = 'nova-consoleproxy'
|
$vncproxy_package_name = 'nova-consoleproxy'
|
||||||
# Use default provider on Debian
|
|
||||||
$special_service_provider = undef
|
|
||||||
$libvirt_service_name = 'libvirtd'
|
$libvirt_service_name = 'libvirtd'
|
||||||
$virtlock_service_name = undef
|
$virtlock_service_name = undef
|
||||||
$virtlog_service_name = undef
|
$virtlog_service_name = undef
|
||||||
@@ -122,8 +116,6 @@ class nova::params {
|
|||||||
$spicehtml5proxy_package_name = 'nova-spiceproxy'
|
$spicehtml5proxy_package_name = 'nova-spiceproxy'
|
||||||
$spicehtml5proxy_service_name = 'nova-spiceproxy'
|
$spicehtml5proxy_service_name = 'nova-spiceproxy'
|
||||||
$vncproxy_package_name = 'nova-novncproxy'
|
$vncproxy_package_name = 'nova-novncproxy'
|
||||||
# some of the services need to be started form the special upstart provider
|
|
||||||
$special_service_provider = 'upstart'
|
|
||||||
$libvirt_service_name = 'libvirt-bin'
|
$libvirt_service_name = 'libvirt-bin'
|
||||||
$virtlock_service_name = 'virtlockd'
|
$virtlock_service_name = 'virtlockd'
|
||||||
$virtlog_service_name = 'virtlogd'
|
$virtlog_service_name = 'virtlogd'
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Stop overriding service providers, and let Puppet finds which one is the best.
|
@@ -30,10 +30,9 @@ describe 'nova::compute::libvirt' do
|
|||||||
|
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_service('libvirt').with(
|
is_expected.to contain_service('libvirt').with(
|
||||||
:name => 'libvirt-bin',
|
:name => 'libvirt-bin',
|
||||||
:enable => true,
|
:enable => true,
|
||||||
:ensure => 'running',
|
:ensure => 'running',
|
||||||
:provider => 'upstart',
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,18 +195,16 @@ describe 'nova::compute::libvirt' do
|
|||||||
) }
|
) }
|
||||||
|
|
||||||
it { is_expected.to contain_service('libvirt').with(
|
it { is_expected.to contain_service('libvirt').with(
|
||||||
:name => 'libvirtd',
|
:name => 'libvirtd',
|
||||||
:enable => true,
|
:enable => true,
|
||||||
:ensure => 'running',
|
:ensure => 'running',
|
||||||
:provider => 'init',
|
:before => ['Service[nova-compute]'],
|
||||||
:before => ['Service[nova-compute]'],
|
|
||||||
)}
|
)}
|
||||||
it { is_expected.to contain_service('messagebus').with(
|
it { is_expected.to contain_service('messagebus').with(
|
||||||
:ensure => 'running',
|
:ensure => 'running',
|
||||||
:enable => true,
|
:enable => true,
|
||||||
:before => ['Service[libvirt]'],
|
:before => ['Service[libvirt]'],
|
||||||
:provider => 'init',
|
:name => 'messagebus'
|
||||||
:name => 'messagebus'
|
|
||||||
) }
|
) }
|
||||||
|
|
||||||
describe 'on rhel 7' do
|
describe 'on rhel 7' do
|
||||||
@@ -218,13 +215,10 @@ describe 'nova::compute::libvirt' do
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_service('libvirt').with(
|
it { is_expected.to contain_service('libvirt')}
|
||||||
:provider => 'redhat'
|
|
||||||
)}
|
|
||||||
|
|
||||||
it { is_expected.to contain_service('messagebus').with(
|
it { is_expected.to contain_service('messagebus').with(
|
||||||
:provider => 'redhat',
|
:name => 'dbus'
|
||||||
:name => 'dbus'
|
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -325,11 +319,10 @@ describe 'nova::compute::libvirt' do
|
|||||||
) }
|
) }
|
||||||
|
|
||||||
it { is_expected.to contain_service('libvirt').with(
|
it { is_expected.to contain_service('libvirt').with(
|
||||||
:name => 'libvirtd',
|
:name => 'libvirtd',
|
||||||
:enable => true,
|
:enable => true,
|
||||||
:ensure => 'running',
|
:ensure => 'running',
|
||||||
:provider => nil,
|
:before => ['Service[nova-compute]']
|
||||||
:before => ['Service[nova-compute]']
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||||
|
Reference in New Issue
Block a user