zuul-jobs/roles/bindep/tasks/find-bindep.yaml
Tristan Cacqueray 8a6b1215c3 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
2018-02-22 06:40:11 +00:00

20 lines
572 B
YAML

- name: Look for bindep command
stat:
path: "{{ bindep_command }}"
when: bindep_command is defined
register: bindep_command_stat
- name: Check for system bindep
command: /bin/bash -c "type -p bindep"
failed_when: false
register: bindep_command_type
when: >-
bindep_command is not defined
or bindep_command_stat is defined
and not bindep_command_stat.stat.exists
- name: Define bindep_command fact
set_fact:
bindep_command: "{{ bindep_command_type.stdout }}"
when: not bindep_command_type|skipped and bindep_command_type.rc == 0