Skip to content

Commit

Permalink
Adds bind parameter to sentinel config
Browse files Browse the repository at this point in the history
  • Loading branch information
prachetasp committed Nov 10, 2015
1 parent 7137d7c commit ffa228b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# Copyright 2013 Felipe Salum, unless otherwise noted.
#
class redis::sentinel (
$conf_bind = '0.0.0.0',
$conf_port = '26379',
$conf_daemonize = 'yes',
$sentinel_confs = [],
Expand Down
15 changes: 11 additions & 4 deletions templates/sentinel.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ pidfile <%= @conf_pidfile_real %>
port <%= @conf_port %>
<%- end -%>

# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
# bind 127.0.0.1
<%- if @conf_bind -%>
bind <%= @conf_bind %>
<%- end -%>

# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
Expand Down Expand Up @@ -134,7 +142,7 @@ sentinel <%= key %> <%= master %> <%= @sentinel_confs[master][key] %>
# NOTIFICATION SCRIPT
#
# sentinel notification-script <master-name> <script-path>
#
#
# Call the specified notification script for any sentinel event that is
# generated in the WARNING level (for instance -sdown, -odown, and so forth).
# This script should notify the system administrator via email, SMS, or any
Expand All @@ -158,14 +166,14 @@ sentinel <%= key %> <%= master %> <%= @sentinel_confs[master][key] %>
# When the master changed because of a failover a script can be called in
# order to perform application-specific tasks to notify the clients that the
# configuration has changed and the master is at a different address.
#
#
# The following arguments are passed to the script:
#
# <master-name> <role> <state> <from-ip> <from-port> <to-ip> <to-port>
#
# <state> is currently always "failover"
# <role> is either "leader" or "observer"
#
#
# The arguments from-ip, from-port, to-ip, to-port are used to communicate
# the old address of the master and the new address of the elected slave
# (now a master).
Expand All @@ -175,4 +183,3 @@ sentinel <%= key %> <%= master %> <%= @sentinel_confs[master][key] %>
# Example:
#
# sentinel client-reconfig-script mymaster /var/redis/reconfig.sh

1 change: 1 addition & 0 deletions tests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}

class { 'redis::sentinel':
conf_bind => '127.0.0.1',
conf_port => '26379',
sentinel_confs => {
'mymaster' => {
Expand Down

0 comments on commit ffa228b

Please sign in to comment.