From 082e02fe6f8a1c2f15d4340578e45668fb74fcaf Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Fri, 19 Jun 2020 13:53:05 +0200 Subject: [PATCH] [Cleanup] redis Space before and after variable names, comparison with empty strings and naming two tasks --- redis/tasks/default-munin.yml | 6 +++--- redis/tasks/instance-munin.yml | 2 +- redis/tasks/main.yml | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/redis/tasks/default-munin.yml b/redis/tasks/default-munin.yml index b7edce3a..6dd01670 100644 --- a/redis/tasks/default-munin.yml +++ b/redis/tasks/default-munin.yml @@ -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 diff --git a/redis/tasks/instance-munin.yml b/redis/tasks/instance-munin.yml index 8d0e207c..b2896153 100644 --- a/redis/tasks/instance-munin.yml +++ b/redis/tasks/instance-munin.yml @@ -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 diff --git a/redis/tasks/main.yml b/redis/tasks/main.yml index 28fda65a..39abc78b 100644 --- a/redis/tasks/main.yml +++ b/redis/tasks/main.yml @@ -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: