From 0534bbf4904a4ab5f99257e11a11b21852a07852 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 21 Jun 2017 07:42:45 -0500 Subject: [PATCH] Fix RPM warnings, cleanup This patch fixes the Ansible warnings about using RPM and it cleans up a "when" to make it easier to read. Change-Id: Iff27f90654a5b21a7e59d7cca4ed6e83cde74716 --- tasks/rabbitmq_upgrade_check.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks/rabbitmq_upgrade_check.yml b/tasks/rabbitmq_upgrade_check.yml index 62135c7e..dc76b77c 100644 --- a/tasks/rabbitmq_upgrade_check.yml +++ b/tasks/rabbitmq_upgrade_check.yml @@ -17,8 +17,7 @@ # so we skip this task in the ansible-lint check by using the # 'skip_ansible_lint' tag - name: Get version of installed RabbitMQ package (deb) - shell: | - dpkg -l | grep rabbitmq-server + shell: "dpkg -l | grep rabbitmq-server" failed_when: false register: installed_rabbitmq_deb when: @@ -33,8 +32,9 @@ # so we skip this task in the ansible-lint check by using the # 'skip_ansible_lint' tag - name: Get version of installed RabbitMQ package (rpm) - shell: | - rpm -qa | grep rabbitmq-server + shell: "rpm -qa | grep rabbitmq-server" + args: + warn: no failed_when: false register: installed_rabbitmq_rpm when: @@ -48,7 +48,9 @@ - name: Register a fact for the installed RabbitMQ version set_fact: installed_rabbitmq: "{{ item }}" - when: not item | skipped and item | changed + when: + - not item | skipped + - item | changed with_items: - "{{ installed_rabbitmq_deb }}" - "{{ installed_rabbitmq_rpm }}"