2017-05-03 16:08:56 +02:00
|
|
|
class openstack_integration::redis {
|
2019-12-08 12:59:28 +01:00
|
|
|
include openstack_integration::config
|
2017-05-03 16:08:56 +02:00
|
|
|
|
2020-09-21 20:14:07 +02:00
|
|
|
# NOTE(tobias-urdin): Manually manage redis until arioch/puppet-redis support
|
2018-05-06 14:18:52 +02:00
|
|
|
# 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'
|
2021-05-20 09:39:59 +02:00
|
|
|
if versioncmp($::operatingsystemmajrelease, '8') > 0 {
|
|
|
|
$redis_config = '/etc/redis/redis.conf'
|
|
|
|
} else {
|
|
|
|
$redis_config = '/etc/redis.conf'
|
|
|
|
}
|
2018-05-06 14:18:52 +02:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
fail("redis.pp manifest does not support family: ${::osfamily}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-21 20:14:07 +02:00
|
|
|
# NOTE(tobias-urdin): Manually manage redis until arioch/puppet-redis support
|
2018-05-06 14:18:52 +02:00
|
|
|
# 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,
|
2022-02-05 23:28:00 +09:00
|
|
|
enable => true,
|
2018-05-06 14:18:52 +02:00
|
|
|
require => File_line['redis_config'],
|
2017-05-03 16:08:56 +02:00
|
|
|
}
|
|
|
|
}
|