From a955f90d989ed8cc5df03439bb27f6a0dd14fd1b Mon Sep 17 00:00:00 2001 From: Colin Wood Date: Fri, 20 Feb 2015 14:43:19 -0800 Subject: [PATCH] Add support for RHEL --- manifests/sentinel.pp | 13 ++++++++----- manifests/sentinel_params.pp | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/manifests/sentinel.pp b/manifests/sentinel.pp index fa9c3ed..b5315ea 100644 --- a/manifests/sentinel.pp +++ b/manifests/sentinel.pp @@ -45,9 +45,9 @@ $service_enable = true, $service_ensure = 'running', $service_restart = true, - $manage_upstart_scripts = true, + $manage_upstart_scripts = $redis::sentinel_params::manage_upstart_scripts, $package_name = undef, -) { +) inherits redis::sentinel_params { include redis::sentinel_params @@ -74,9 +74,12 @@ $conf_logfile_real = $::redis::sentinel_params::logfile } - package { 'redis': - ensure => $package_ensure, - name => $package, + unless defined(Package["redis"]) { + + package { 'redis': + ensure => $package_ensure, + name => $package, + } } if $manage_upstart_scripts == true { diff --git a/manifests/sentinel_params.pp b/manifests/sentinel_params.pp index 5fc8bf7..33b68c7 100644 --- a/manifests/sentinel_params.pp +++ b/manifests/sentinel_params.pp @@ -13,17 +13,17 @@ class redis::sentinel_params { case $::osfamily { - # TODO: add redhat support - #'redhat': { - # $package = 'redis' - # $service = 'redis-sentinel' - # $conf = '/etc/sentinel.conf' - # $conf_dir = undef - # $conf_logrotate = '/etc/logrotate.d/sentinel' - # $pidfile = '/var/run/redis/sentinel.pid' - # $logfile = '/var/log/redis/sentinel.log' - # $upstart_script = '/etc/init/redis-sentinel.conf' - #} + 'redhat': { + $package = 'redis' + $service = 'redis-sentinel' + $conf = '/etc/redis-sentinel.conf' + $conf_dir = undef + $conf_logrotate = '/etc/logrotate.d/sentinel' + $pidfile = '/var/run/redis/sentinel.pid' + $logfile = '/var/log/redis/sentinel.log' + $upstart_script = '/etc/init/redis-sentinel.conf' + $manage_upstart_scripts = false + } 'debian': { $package = 'redis-server' $service = 'redis-sentinel'