Skip to content

Commit c9de95f

Browse files
committed
Added auth-pass to redis sentinel
1 parent 8f9c2bc commit c9de95f

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
$port = 6379
3535
$rdbcompression = true
3636
$requirepass = undef
37+
$sentinel_auth_pass = undef
3738
$sentinel_config_file_mode = '0644'
3839
$sentinel_config_group = 'root'
3940
$sentinel_config_owner = 'redis'

manifests/sentinel.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
#
55
# == Parameters:
66
#
7+
#
8+
# [*auth_pass*]
9+
# The password to use to authenticate with the master and slaves.
10+
#
11+
# Default: undef
12+
#
713
# [*config_file*]
814
# The location and name of the sentinel config file.
915
#
@@ -138,6 +144,7 @@
138144
# }
139145
#
140146
class redis::sentinel (
147+
$auth_pass = $::redis::params::sentinel_auth_pass,
141148
$config_file = $::redis::params::sentinel_config_file,
142149
$config_file_orig = $::redis::params::sentinel_config_file_orig,
143150
$config_file_mode = $::redis::params::sentinel_config_file_mode,

templates/redis-sentinel.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ sentinel monitor <%= @master_name %> <%= @redis_host %> <%= @redis_port %> <%= @
77
sentinel down-after-milliseconds <%= @master_name %> <%= @down_after %>
88
sentinel parallel-syncs <%= @master_name %> <%= @parallel_sync %>
99
sentinel failover-timeout <%= @master_name %> <%= @failover_timeout %>
10+
<% if @auth_pass -%>
11+
sentinel auth-pass <%= @master_name %> <%= @auth_pass %>
12+
<% end -%>
1013
<% if @notification_script -%>
1114
sentinel notification-script <%= @master_name %> <%= @notification_script %>
1215
<% end -%>

0 commit comments

Comments
 (0)