From deb1d3e6212d9ec6605510554bf268d18688513e Mon Sep 17 00:00:00 2001 From: Jean-Louis Jouannic Date: Fri, 12 Jul 2019 15:32:56 +0200 Subject: [PATCH] Fixes bare variables in conditionals (deprecation warnings with Ansible 2.8+) --- CHANGELOG.md | 2 +- tasks/rubies.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65aa34c2a..3c402e4af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### NEXT -* ... +* Fixes bare variables in conditionals (deprecation warnings with Ansible 2.8+) (#204) ### 2.1.2 2018-12-28 · [Changes](https://github.com/rvm/rvm1-ansible/compare/v2.1.1...v2.1.2) diff --git a/tasks/rubies.yml b/tasks/rubies.yml index 212dc22b3..1d91c3e27 100644 --- a/tasks/rubies.yml +++ b/tasks/rubies.yml @@ -6,11 +6,11 @@ failed_when: False register: detect_rubies with_items: '{{ rvm1_rubies }}' - when: rvm1_rubies + when: rvm1_rubies | bool - name: Install rubies command: '{{ rvm1_rvm }} install {{ item.item }} {{ rvm1_ruby_install_flags }}' - when: rvm1_rubies and item.rc|default(0) != 0 + when: rvm1_rubies | bool and item.rc|default(0) != 0 with_items: '{{ detect_rubies.results }}' - name: Detect default ruby version @@ -67,9 +67,9 @@ changed_when: False failed_when: False register: detect_delete_ruby - when: rvm1_delete_ruby + when: rvm1_delete_ruby | bool - name: Delete ruby version command: '{{ rvm1_rvm }} remove {{ rvm1_delete_ruby }}' changed_when: False - when: rvm1_delete_ruby and detect_delete_ruby.rc == 0 + when: rvm1_delete_ruby | bool and detect_delete_ruby.rc == 0