redis: add variables to prevent or force restart

This commit is contained in:
Jérémy Lecour 2018-12-21 11:11:15 +01:00 committed by Jérémy Lecour
parent 3b63172532
commit 92a25a9502
4 changed files with 20 additions and 1 deletions

View file

@ -13,6 +13,8 @@ The **patch** part changes incrementally at each release.
### Added
* evomaintenance: database variables must be set or the task fails
* redis: Configure munin when working in instance mode
* redis: add a variable to disable the restart handler
* redis: add a variable to force a restart (even with no change)
### Changed
* redis: distinction between main and master password

View file

@ -40,3 +40,6 @@ redis_protected_mode: "yes"
# Add extra include files for local configuration/overrides.
redis_includes: []
redis_restart_if_needed: True
redis_restart_force: False

View file

@ -4,6 +4,11 @@
name: "{{ redis_daemon }}"
state: restarted
- name: restart redis (noop)
meta: noop
failed_when: False
changed_when: False
- name: restart munin-node
service:
name: munin-node

View file

@ -1,4 +1,8 @@
---
- set_fact:
redis_restart_handler_name: "{{ redis_restart_if_needed | ternary('restart redis', 'restart redis (noop)') }}"
- name: Redis is installed.
apt:
name: "{{ item }}"
@ -32,7 +36,7 @@
src: redis.conf.j2
dest: "{{ redis_conf_path }}"
mode: "0644"
notify: restart redis
notify: "{{ redis_restart_handler_name }}"
when: redis_instance_name is not defined
tags:
- redis
@ -86,3 +90,8 @@
tags:
- redis
- nrpe
- name: Force restart redis
command: /bin/true
notify: restart redis
when: redis_restart_force