Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
add force_rewrite parameter, update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans-Joachim Skwirblies committed May 7, 2015
1 parent 60d9635 commit 6430e2e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ Configure if Redis should be running or not. Default: true (boolean)

Configure if Redis is started at boot. Default: true (boolean)

#####`force_rewrite`

Boolean. Default: `false`

Configure if the sentinels config is overwritten by puppet followed by a
sentinel restart. Since sentinels automatically rewrite their config since
version 2.8 setting this to `true` will trigger a sentinel restart on each puppet
run with redis 2.8 or later.

##Requirements

###Modules needed:
Expand Down
16 changes: 15 additions & 1 deletion manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
# Configure if Sentinel should be running or not. Default: true
# [*enabled*]
# Configure if Sentinel is started at boot. Default: true
# [*force_rewrite*]
#
# Boolean. Default: `false`
#
# Configure if the sentinels config is overwritten by puppet followed by a
# sentinel restart. Since sentinels automatically rewrite their config since
# version 2.8 setting this to `true` will trigger a sentinel restart on each puppet
# run with redis 2.8 or later.
#
define redis::sentinel (
$ensure = 'present',
Expand All @@ -54,9 +62,13 @@
}
},
$running = true,
$enabled = true
$enabled = true,
$force_rewrite = false,
) {

# validate parameters
validate_bool($force_rewrite)

$redis_install_dir = $::redis::install::redis_install_dir
$sentinel_init_script = $::operatingsystem ? {
/(Debian|Ubuntu)/ => 'redis/etc/init.d/debian_redis-sentinel.erb',
Expand All @@ -69,7 +81,9 @@
"/etc/redis-sentinel_${sentinel_name}.conf":
ensure => file,
content => template('redis/etc/sentinel.conf.erb'),
replace => $force_rewrite,
require => Class['redis::install'];

}->

# startup script
Expand Down

0 comments on commit 6430e2e

Please sign in to comment.