Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 5d87fa1

Browse files
Merge pull request #104 from tobiashuste/103-allow-to-configure-a-password-for-redis-sentinel
feat: allow to configure authentication for sentinel
2 parents 91077bf + 5f365c3 commit 5d87fa1

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ Redis Sentinel service file path:
9494
redis_sentinel_service_file: '{{ redis_systemd_dir }}/redis-sentinel.service'
9595
```
9696

97+
Password for Redis Sentinel. This is unset by default.
98+
99+
```yaml
100+
redis_sentinel_password: 'changeme'
101+
```
102+
97103
Redis configuration directory path:
98104
```yaml
99105
redis_configuration_dir: '/etc/redis'

molecule/default/molecule.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ provisioner:
2424
playbooks:
2525
prepare: prepare.yml
2626
converge: converge.yml
27+
inventory:
28+
hosts:
29+
all:
30+
vars:
31+
redis_sentinel_password: "123456"
2732
verifier:
2833
name: ansible
2934
scenario:

templates/sentinel.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ dir /var/lib/redis/
1212
bind {{ redis_instance_ip }}
1313
port 26379
1414

15+
{% if (redis_sentinel_password is defined) and (redis_sentinel_password|length > 0) %}
16+
requirepass "{{ redis_sentinel_password }}"
17+
{% endif %}
18+
1519
sentinel monitor {{ redis_cluster_name }} {{ redis_master_instance_ip }} 6379 2
1620
sentinel auth-pass {{ redis_cluster_name }} {{ redis_password }}
1721
sentinel down-after-milliseconds {{ redis_cluster_name }} 10000

0 commit comments

Comments
 (0)