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

View file

@ -39,7 +39,7 @@
- name: Enable redis munin plugin - name: Enable redis munin plugin
file: file:
src: /usr/local/share/munin/plugins/redis_ 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 state: link
with_items: with_items:
- connected_clients - 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)') }}" redis_restart_handler_name: "{{ redis_restart_if_needed | ternary('restart redis', 'restart redis (noop)') }}"
- name: Redis is installed. - name: Redis is installed.
@ -30,7 +31,8 @@
tags: tags:
- redis - redis
- set_fact: - name: "Define which version of redis is installed"
set_fact:
redis_installed_version: "{{ _redis_installed_version.stdout }}" redis_installed_version: "{{ _redis_installed_version.stdout }}"
check_mode: no check_mode: no
tags: tags: