31f6026ab9
Change-Id: I34026836ac42dd6f2a5e5dfc05203c460cc949fc
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
---
|
|
|
|
- name: "ensure Bindep is installed"
|
|
command: >
|
|
'{{ python_executable }}' -m pip install --user 'bindep>={{ bindep_min_version }}'
|
|
register: install_bindep
|
|
changed_when: "'Successfully installed' in install_bindep.stdout"
|
|
|
|
|
|
- block:
|
|
- name: "get '{{ bindep_command }}' full path"
|
|
shell: |
|
|
export PATH={{ python_exe_path }}
|
|
which '{{ bindep_command }}'
|
|
register: get_bindep_path
|
|
|
|
- name: "set bindep_executable fact"
|
|
set_fact:
|
|
bindep_executable: '{{ get_bindep_path.stdout_lines | first }}'
|
|
|
|
rescue:
|
|
- name: "set bindep_executable fact"
|
|
set_fact:
|
|
bindep_executable: '{{ ansible_user_dir }}/.local/bin/bindep'
|
|
|
|
|
|
- name: "get '{{ bindep_executable }}' version"
|
|
shell: "'{{ bindep_executable }}' --version 2>&1"
|
|
register: get_bindep_version
|
|
failed_when: '(get_bindep_version.stdout_lines | length) == 0'
|
|
|
|
|
|
- name: "update bindep_version fact"
|
|
set_fact:
|
|
bindep_version: '{{ get_bindep_version.stdout_lines | first }}'
|
|
|
|
|
|
- name: "show Bindep facts"
|
|
debug:
|
|
msg:
|
|
bindep_executable: '{{ bindep_executable }}'
|
|
bindep_version: '{{ bindep_version }}'
|