redis: binding is possible on multiple interfaces

pull/157/head
Jérémy Lecour 6 months ago committed by Jérémy Lecour
parent 1895c549d4
commit b677defd97
  1. 2
      CHANGELOG.md
  2. 2
      redis/README.md
  3. 3
      redis/defaults/main.yml
  4. 8
      redis/tasks/main.yml
  5. 2
      redis/tasks/nrpe.yml
  6. 2
      redis/templates/redis.conf.j2

@ -14,6 +14,8 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Changed
* redis: binding is possible on multiple interfaces (breaking change)
### Fixed
### Removed

@ -14,7 +14,7 @@ Main variables are :
* `redis_conf_dir`: config directory ;
* `redis_port`: listening TCP port ;
* `redis_bind_interface`: listening IP address ;
* `redis_bind_interfaces`: listening IP addresses (array) ;
* `redis_password`: password for redis. Empty means no password ;
* `redis_socket_dir`: Unix socket directory ;
* `redis_log_level`: log verbosity ;

@ -6,7 +6,8 @@ redis_conf_dir_prefix: /etc/redis
redis_force_instance_port: False
redis_port: 6379
redis_bind_interface: 127.0.0.1
redis_bind_interfaces:
- 127.0.0.1
redis_socket_enabled: True
redis_socket_dir_prefix: '/run/redis'

@ -63,6 +63,14 @@
redis_data_dir: "{{ redis_data_dir_prefix }}-{{ redis_instance_name }}"
when: redis_instance_name is defined
- name: Fail if redis_bind_interface is set
fail:
msg: "Please change 'redis_bind_interface' (String) to 'redis_bind_interfaces' (List)"
when:
- redis_bind_interface is defined
- redis_bind_interface is not none
- redis_bind_interface | length > 0
- name: configure Redis for default mode
include: default-server.yml
when: redis_instance_name is not defined

@ -60,7 +60,7 @@
replace:
dest: /etc/nagios/nrpe.d/evolix.cfg
regexp: '^command\[check_redis\]=.+'
replace: 'command[check_redis]=sudo {{ redis_check_redis_path }} -H {{ redis_bind_interface }} -p {{ redis_port }}'
replace: 'command[check_redis]=sudo {{ redis_check_redis_path }} -H {{ redis_bind_interfaces | first }} -p {{ redis_port }}'
when: redis_instance_name is undefined
notify: restart nagios-nrpe-server
tags:

@ -1,7 +1,7 @@
daemonize yes
pidfile {{ redis_pid_dir }}/redis-server.pid
port {{ redis_port }}
bind {{ redis_bind_interface }}
bind {{ redis_bind_interfaces | join(' ') }}
{% if redis_socket_enabled %}
unixsocket {{ redis_socket_dir }}/redis.sock

Loading…
Cancel
Save