81687e2ead
In Puppet 3 there was a need to use absolute names to prevent issues. Since Puppet 4 everything is absolute by default which makes this not needed. We need to change this everywhere so that we can revert the pin in [1] that now prevents us from using the latest version of the puppet-lint check puppet-lint-absolute_classname_check that properly checks that we dont use absolute names. [1] https://review.opendev.org/#/c/697742/ Change-Id: I78b74fbeb08be7234189e4d266412fb7fb7a73c0
54 lines
1.5 KiB
Puppet
54 lines
1.5 KiB
Puppet
class openstack_integration::redis {
|
|
include openstack_integration::config
|
|
|
|
# NOTE(tobasco): Manually manage redis until arioch/puppet-redis support
|
|
# redis 4.x since that is used by Ubuntu Bionic.
|
|
case $::osfamily {
|
|
'Debian': {
|
|
$redis_package_name = 'redis-server'
|
|
$redis_service_name = 'redis-server'
|
|
$redis_config = '/etc/redis/redis.conf'
|
|
}
|
|
'RedHat': {
|
|
$redis_package_name = 'redis'
|
|
$redis_service_name = 'redis'
|
|
$redis_config = '/etc/redis.conf'
|
|
}
|
|
default: {
|
|
fail("redis.pp manifest does not support family: ${::osfamily}")
|
|
}
|
|
}
|
|
|
|
# due to issues in OpenStack CI with the redis package, we need to disable
|
|
# the service enable flag. The service still starts but the management of
|
|
# the service with systemd errors.
|
|
if ($::os_package_type == 'debian') {
|
|
$service_enable = false
|
|
} else {
|
|
$service_enable = true
|
|
}
|
|
|
|
# NOTE(tobasco): Manually manage redis until arioch/puppet-redis support
|
|
# redis 4.x since that is used by Ubuntu Bionic.
|
|
package { 'redis':
|
|
ensure => 'present',
|
|
name => $redis_package_name,
|
|
}
|
|
|
|
file_line { 'redis_config':
|
|
ensure => 'present',
|
|
path => $redis_config,
|
|
line => "bind ${::openstack_integration::config::host}",
|
|
match => '^bind\ ',
|
|
require => Package['redis'],
|
|
notify => Service['redis'],
|
|
}
|
|
|
|
service { 'redis':
|
|
ensure => 'running',
|
|
name => $redis_service_name,
|
|
enable => $service_enable,
|
|
require => File_line['redis_config'],
|
|
}
|
|
}
|