Skip to content

Commit

Permalink
Fix Redis sentinel configuration file permissions
Browse files Browse the repository at this point in the history
The Sentinel config file contains the Redis password, and therefore,
cannot be publicly readable.

Also ensure files have the redis group set.
  • Loading branch information
danielkza committed Nov 25, 2016
1 parent dc50158 commit b22c3e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/sentinel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,23 @@
src: redis_sentinel.conf.j2
dest: /etc/redis/sentinel_{{ redis_sentinel_port }}.conf
owner: "{{ redis_user }}"
group: "{{ redis_group }}"
mode: 0640
notify: restart sentinel

- name: add sentinel init config file
template:
dest: /etc/sysconfig/sentinel_{{ redis_sentinel_port }}
src: redis.init.conf.j2
mode: 0600
when: ansible_os_family == "RedHat"
notify: restart sentinel

- name: add sentinel init config file
template:
dest: /etc/default/sentinel_{{ redis_sentinel_port }}
src: redis.init.conf.j2
mode: 0600
when: ansible_os_family == "Debian"
notify: restart sentinel

Expand Down
1 change: 1 addition & 0 deletions tasks/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
src: redis.conf.j2
dest: /etc/redis/{{ redis_port }}.conf
owner: "{{ redis_user }}"
group: "{{ redis_group }}"
mode: 0640
notify: restart redis

Expand Down

0 comments on commit b22c3e3

Please sign in to comment.