Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issues 111 and 150 #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@
mode => $::redis::config_dir_mode;

$::redis::config_file_orig:
ensure => present,
content => template($::redis::conf_template);
ensure => file,
owner => $::redis::config_owner,
group => $::redis::config_group;

$::redis::log_dir:
ensure => directory,
Expand All @@ -104,18 +105,23 @@
owner => $::redis::service_user;
}

exec {
"cp -p ${::redis::config_file_orig} ${::redis::config_file}":
path => '/usr/bin:/bin',
subscribe => File[$::redis::config_file_orig],
refreshonly => true;
} ~> Service <| title == $::redis::service_name |>
if (($::redis::redis_version_real) and (versioncmp('2.8.24', $::redis::redis_version_real) < 0)) {
File[$::redis::config_file_orig] { content => template($::redis::conf_template) }
} else {
File[$::redis::config_file_orig] { content => template('redis/redis.conf.2.x.erb') }
}

exec { "cp -p ${::redis::config_file_orig} ${::redis::config_file}":
Copy link

@nvtkaszpir nvtkaszpir Apr 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 144 - Please make it as description and move this to command parameter

path => '/usr/bin:/bin',
subscribe => File[$::redis::config_file_orig],
refreshonly => true;
}

# Adjust /etc/default/redis-server on Debian systems
case $::osfamily {
'Debian': {
file { '/etc/default/redis-server':
ensure => present,
ensure => file,
group => $::redis::config_group,
mode => $::redis::config_file_mode,
owner => $::redis::config_owner,
Expand Down
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@
#
# Default: 0
#
# [*minimum_version*]
# Minimum version which will be installed from repo for current OS
#
# Default: OS dependant
#
# [*no_appendfsync_on_rewrite*]
# If you have latency problems turn this to 'true'. Otherwise leave it as
# 'false' that is the safest pick from the point of view of durability.
Expand Down Expand Up @@ -566,6 +571,7 @@
$maxmemory_samples = $::redis::params::maxmemory_samples,
$min_slaves_max_lag = $::redis::params::min_slaves_max_lag,
$min_slaves_to_write = $::redis::params::min_slaves_to_write,
$minimum_version = $::redis::params::minimum_version,
$no_appendfsync_on_rewrite = $::redis::params::no_appendfsync_on_rewrite,
$notify_keyspace_events = $::redis::params::notify_keyspace_events,
$notify_service = $::redis::params::notify_service,
Expand Down Expand Up @@ -619,6 +625,8 @@
anchor { 'redis::begin': }
anchor { 'redis::end': }

$redis_version_real = pick($::redis_server_version, $minimum_version)

include ::redis::preinstall
include ::redis::install
include ::redis::config
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
$config_file = '/etc/redis/redis.conf'
$config_file_mode = '0644'
$config_file_orig = '/etc/redis/redis.conf.puppet'
$config_group = 'root'
$config_owner = 'redis'
$daemonize = true
$log_dir_mode = '0755'
Expand All @@ -130,10 +129,12 @@

case $::operatingsystem {
'Ubuntu': {
$config_group = 'redis'
# Latest from PPA is 3.0.7
$minimum_version = '3.0.7'
}
default: {
$config_group = 'root'
# Debian standard package is 2.4.14
# But we have dotdeb repo which is 3.2.5
$minimum_version = '3.2.5'
Expand Down
Loading