522a78385a
Extend bindep role to be able to install packages from multiple paths at once. This behavior is fully compatible with current implementation, however it allows to pass number of bindep file paths. Change-Id: I70d42f25837ff282aad534f9ead965d12858ac9b
30 lines
886 B
YAML
30 lines
886 B
YAML
- name: Define bindep_run fact
|
|
set_fact:
|
|
bindep_run: "{{ bindep_command }} -b -f {{ zj_bindep_file }} {{ bindep_profile }}"
|
|
|
|
- name: Get list of packages to install from bindep
|
|
command: "{{ bindep_run }}"
|
|
register: bindep_output
|
|
failed_when: false
|
|
changed_when: false
|
|
|
|
- name: Install distro packages from bindep
|
|
package:
|
|
name: "{{ bindep_output.stdout_lines }}"
|
|
state: present
|
|
become: true
|
|
when: bindep_output.stdout_lines
|
|
changed_when: true
|
|
|
|
- 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
|
|
changed_when: false
|
|
|
|
- name: Fail if we cannot install all packages
|
|
fail:
|
|
msg: "bindep failed to install from {{ zj_bindep_file }} - {{ bindep_final_check.stdout }}"
|
|
when: bindep_final_check is failed
|