Cleanup compat code for puppet <4.5

... because we no longer support puppet 4.

Change-Id: I80b8ee9c6bcff7e3985f5135123430e4f269849c
This commit is contained in:
Takashi Kajinami 2020-06-04 21:47:07 +09:00
parent 8e6e6c3aa6
commit c0d0bcf3d8
2 changed files with 13 additions and 26 deletions

View File

@ -61,20 +61,18 @@ class nova::compute::libvirt::services (
tag => ['openstack', 'nova-support-package'], tag => ['openstack', 'nova-support-package'],
} }
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 => Anchor['nova::install::end'],
require => Anchor['nova::install::end'],
} }
# messagebus # messagebus
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']
} }
@ -86,20 +84,18 @@ class nova::compute::libvirt::services (
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,
} }
Package<| name == 'libvirt' |> -> Service['virtlockd'] Package<| name == 'libvirt' |> -> Service['virtlockd']
} }
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,
} }
Package<| name == 'libvirt' |> -> Service['virtlogd'] Package<| name == 'libvirt' |> -> Service['virtlogd']
} }

View File

@ -55,19 +55,12 @@ class nova::params {
'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 = undef
} else { } else {
if (versioncmp($::puppetversion, '4.5') < 0) {
$special_service_provider = 'redhat'
} else {
$special_service_provider = undef
}
$messagebus_service_name = 'dbus' $messagebus_service_name = 'dbus'
} }
} }
default: { default: {
# not required on Fedora # not required on Fedora
$special_service_provider = undef
$messagebus_service_name = undef $messagebus_service_name = undef
} }
} }
@ -116,7 +109,6 @@ class nova::params {
$vncproxy_package_name = 'nova-consoleproxy' $vncproxy_package_name = 'nova-consoleproxy'
$serialproxy_package_name = 'nova-consoleproxy' $serialproxy_package_name = 'nova-consoleproxy'
# Use default provider on Debian # Use default provider on Debian
$special_service_provider = undef
$virtlock_service_name = 'virtlockd' $virtlock_service_name = 'virtlockd'
$virtlog_service_name = 'virtlogd' $virtlog_service_name = 'virtlogd'
} }
@ -127,7 +119,6 @@ class nova::params {
$vncproxy_package_name = 'nova-novncproxy' $vncproxy_package_name = 'nova-novncproxy'
$serialproxy_package_name = 'nova-serialproxy' $serialproxy_package_name = 'nova-serialproxy'
# Use default provider on Debian # Use default provider on Debian
$special_service_provider = undef
$virtlock_service_name = 'virtlockd' $virtlock_service_name = 'virtlockd'
$virtlog_service_name = 'virtlogd' $virtlog_service_name = 'virtlogd'
} }