ea5c3d08da
When bindep test doesn't output package, there is no need to run the package task. Change-Id: I6f13e060a6d9657d3dec4f43a0b9c2dbff2d362d
23 lines
682 B
YAML
23 lines
682 B
YAML
- name: Get list of packages to install from bindep
|
|
command: "{{ bindep_run }}"
|
|
register: bindep_output
|
|
failed_when: false
|
|
|
|
- name: Install distro packages from bindep
|
|
package:
|
|
name: "{{ bindep_output.stdout_lines }}"
|
|
state: present
|
|
become: yes
|
|
when: bindep_output.stdout_lines
|
|
|
|
- name: Check that packages are installed
|
|
command: "{{ bindep_run }}"
|
|
register: bindep_final_check
|
|
# Ignore errors then fail later so that we can give a better error message
|
|
failed_when: false
|
|
|
|
- name: Fail if we cannot install all packages
|
|
fail:
|
|
msg: "bindep failed to install from {{ bindep_file}} - {{ bindep_final_check.stdout }}"
|
|
when: bindep_final_check|failed
|