From 8a6b1215c3716853b45b5763d050506c232b03a9 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Thu, 22 Feb 2018 05:55:36 +0000 Subject: [PATCH] bindep: use shell instead of command with executable As of Ansible 2.4, the parameter 'executable' is no longer supported with the 'command' module. Also check for return code since it the |succeed changed and now always returns True when using failed_when: false. Change-Id: I4c33db7f3d6fd613a6144f7520054cbcf50684e1 --- roles/bindep/tasks/find-bindep.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/roles/bindep/tasks/find-bindep.yaml b/roles/bindep/tasks/find-bindep.yaml index 502fb81d2..ecdcbaf3a 100644 --- a/roles/bindep/tasks/find-bindep.yaml +++ b/roles/bindep/tasks/find-bindep.yaml @@ -5,9 +5,7 @@ register: bindep_command_stat - name: Check for system bindep - args: - executable: /bin/bash - command: type -p bindep + command: /bin/bash -c "type -p bindep" failed_when: false register: bindep_command_type when: >- @@ -18,4 +16,4 @@ - name: Define bindep_command fact set_fact: bindep_command: "{{ bindep_command_type.stdout }}" - when: bindep_command_type|succeeded and not bindep_command_type|skipped + when: not bindep_command_type|skipped and bindep_command_type.rc == 0