diff --git a/Puppetfile b/Puppetfile index e98af6d76..8e5ee4f41 100644 --- a/Puppetfile +++ b/Puppetfile @@ -238,3 +238,6 @@ mod 'ssh_keygen', :git => 'https://github.com/voxpupuli/puppet-ssh_keygen', :ref => 'v2.0.1' +mod 'redis', + :git => 'https://github.com/voxpupuli/puppet-redis', + :ref => 'v8.2.0' diff --git a/external_modules.txt b/external_modules.txt index f5b59dea9..315512003 100644 --- a/external_modules.txt +++ b/external_modules.txt @@ -21,3 +21,4 @@ theforeman/puppet-dns voxpupuli/puppet-archive voxpupuli/puppet-corosync,v8.0.0 voxpupuli/puppet-ssh_keygen,v2.0.1 +voxpupuli/puppet-redis diff --git a/manifests/redis.pp b/manifests/redis.pp index 3312fca9e..4b8168450 100644 --- a/manifests/redis.pp +++ b/manifests/redis.pp @@ -1,21 +1,16 @@ class openstack_integration::redis { include openstack_integration::config - # NOTE(tobias-urdin): Manually manage redis until arioch/puppet-redis support - # redis 4.x since that is used by Ubuntu Bionic. + # TODO(tkajinam): Remove this once puppet-redis supports CentOS 9 case $::osfamily { 'Debian': { - $redis_package_name = 'redis-server' - $redis_service_name = 'redis-server' - $redis_config = '/etc/redis/redis.conf' + $redis_config = '/etc/redis/redis.conf' } 'RedHat': { - $redis_package_name = 'redis' - $redis_service_name = 'redis' if versioncmp($::operatingsystemmajrelease, '8') > 0 { - $redis_config = '/etc/redis/redis.conf' + $redis_config = '/etc/redis/redis.conf' } else { - $redis_config = '/etc/redis.conf' + $redis_config = '/etc/redis.conf' } } default: { @@ -23,26 +18,10 @@ class openstack_integration::redis { } } - # NOTE(tobias-urdin): 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 => true, - require => File_line['redis_config'], + class { 'redis': + bind => $::openstack_integration::config::host, + config_file => $redis_config, + config_file_orig => "${redis_config}.puppet", + ulimit_managed => false, } }