Merge "Allow bindep role to read from more then one bindep file"

This commit is contained in:
Zuul 2020-11-02 22:37:57 +00:00 committed by Gerrit Code Review
commit b91fb9e066
3 changed files with 12 additions and 5 deletions

View File

@ -19,7 +19,7 @@ then install the missing packages.
.. zuul:rolevar:: bindep_file .. zuul:rolevar:: bindep_file
Path to a specific bindep file to read from. Path or list of paths to a specific bindep file(s) to read from.
.. zuul:rolevar:: bindep_command .. zuul:rolevar:: bindep_command

View File

@ -10,10 +10,13 @@
- bindep_file is defined - bindep_file is defined
- bindep_command is not defined - bindep_command is not defined
- name: Define bindep_run fact - name: Convert bindep_file to list
set_fact: set_fact:
bindep_run: "{{ bindep_command }} -b -f {{ bindep_file }} {{ bindep_profile }}" bindep_file: "{{ [bindep_file] }}"
when: bindep_file is defined when: bindep_file is defined and bindep_file is string
- include_tasks: packages.yaml - include_tasks: packages.yaml
loop: "{{ bindep_file }}"
loop_control:
loop_var: zj_bindep_file
when: bindep_file is defined when: bindep_file is defined

View File

@ -1,3 +1,7 @@
- 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 - name: Get list of packages to install from bindep
command: "{{ bindep_run }}" command: "{{ bindep_run }}"
register: bindep_output register: bindep_output
@ -21,5 +25,5 @@
- name: Fail if we cannot install all packages - name: Fail if we cannot install all packages
fail: fail:
msg: "bindep failed to install from {{ bindep_file }} - {{ bindep_final_check.stdout }}" msg: "bindep failed to install from {{ zj_bindep_file }} - {{ bindep_final_check.stdout }}"
when: bindep_final_check is failed when: bindep_final_check is failed