Fix bindep path

Project config's site variables is already overriding the
bindep_command variable [1], which is used in the bindep
role. It's therefore impossible to override it with
the path given in the playbook.

This patch doesn't fully need the bindep role, as the
whole purpose of this repo is to test bindep's behavior.

Therefore this changes the play to use the checked-in
bindep to install the appropriate packages, instead
of /usr/bindep-env/bin/bindep.

[1]: http://git.openstack.org/cgit/openstack-infra/project-config/tree/zuul/site-variables.yaml#n9

Change-Id: Iff71edaf20ef81c16eebfd3fe57c4e809d007e89
This commit is contained in:
Jean-Philippe Evrard 2018-08-02 16:09:17 +02:00
parent cec3a7576b
commit ccbde48914

View File

@ -1,5 +1,9 @@
- hosts: all - hosts: all
pre_tasks: vars:
bindep_profile: test
# Define the global file so that no local file gets used.
bindep_file: /usr/local/bindep-fallback/bindep-fallback.txt
tasks:
- name: Install requirements - name: Install requirements
pip: pip:
chdir: "{{ zuul_work_dir }}" chdir: "{{ zuul_work_dir }}"
@ -12,9 +16,15 @@
virtualenv: "{{ zuul_work_virtualenv }}" virtualenv: "{{ zuul_work_virtualenv }}"
name: . name: .
roles: - name: Run bindep with the file
- role: bindep command: "{{ zuul_work_virtualenv }}/bin/bindep -b -f {{ bindep_file }} {{ bindep_profile }}"
bindep_profile: test register: _bindep_output
bindep_command: "{{ zuul_work_virtualenv }}/bin/bindep" changed_when: false
# Define the global file so that no local file gets used. failed_when: false
bindep_file: /usr/local/bindep-fallback/bindep-fallback.txt
- name: Install distro packages from bindep
package:
name: "{{ _bindep_output.stdout_lines }}"
state: present
become: yes
when: _bindep_output.stdout_lines