[Cleanup] redis

Space before and after variable names, comparison with empty strings and
naming two tasks
This commit is contained in:
Mathieu Trossevin 2020-06-19 13:53:05 +02:00
parent 9e0202d3de
commit 082e02fe6f
Signed by: mtrossevin
GPG key ID: 81987323AE7F3E99
3 changed files with 8 additions and 6 deletions

View file

@ -39,7 +39,7 @@
- name: Enable redis munin plugin
file:
src: /usr/local/share/munin/plugins/redis_
dest: "/etc/munin/plugins/redis_{{item}}"
dest: "/etc/munin/plugins/redis_{{ item }}"
state: link
with_items:
- connected_clients
@ -67,7 +67,7 @@
value: '{{ redis_password }}'
notify: restart munin-node
when:
- redis_password != ''
- redis_password
- redis_password != None
- (munin_redis_blocs_in_config.stdout | int) <= 1
tags: redis
@ -77,6 +77,6 @@
debug:
msg: "WARNING - It seems you have multiple redis sections in your munin-node configuration - Munin config NOT changed"
when:
- redis_password != ''
- redis_password
- redis_password != None
- (munin_redis_blocs_in_config.stdout | int) > 1

View file

@ -39,7 +39,7 @@
- name: Enable redis munin plugin
file:
src: /usr/local/share/munin/plugins/redis_
dest: "/etc/munin/plugins/{{ redis_instance_name }}_redis_{{item}}"
dest: "/etc/munin/plugins/{{ redis_instance_name }}_redis_{{ item }}"
state: link
with_items:
- connected_clients

View file

@ -1,6 +1,7 @@
---
- set_fact:
- name: "Define if redis needs to restart or not"
set_fact:
redis_restart_handler_name: "{{ redis_restart_if_needed | ternary('restart redis', 'restart redis (noop)') }}"
- name: Redis is installed.
@ -30,7 +31,8 @@
tags:
- redis
- set_fact:
- name: "Define which version of redis is installed"
set_fact:
redis_installed_version: "{{ _redis_installed_version.stdout }}"
check_mode: no
tags: