Add role to ensure tox is installed on target host
Change-Id: I8d2ee07bc84efb7eb0eb23a64ecdff97fd5cecb6
This commit is contained in:
parent
10c1eda1fc
commit
5c1edfac76
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
tox_executable: tox
|
||||||
|
tox_min_version: 3.4
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- role: tobiko-common
|
||||||
|
- role: tobiko-ensure-python
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: "ensure Tox is installed"
|
||||||
|
command: |
|
||||||
|
'{{ python_executable }}' -m pip install --user 'tox>={{ tox_min_version }}'
|
||||||
|
register: result
|
||||||
|
changed_when: "'Successfully installed' in result.stdout"
|
||||||
|
|
||||||
|
|
||||||
|
- name: "set tox_executable fact"
|
||||||
|
set_fact:
|
||||||
|
tox_executable: "{{ ansible_user_dir }}/.local/bin/tox"
|
||||||
|
cacheable: true
|
||||||
|
when: result is changed
|
||||||
|
|
||||||
|
|
||||||
|
- name: "get installed Tox version"
|
||||||
|
command: "{{ tox_executable }} --version"
|
||||||
|
register: get_installed_tox_version
|
||||||
|
|
||||||
|
|
||||||
|
- name: "show Tox installed version"
|
||||||
|
debug: var=get_installed_tox_version.stdout_lines
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Directory where test cases has been deployed to
|
# Directory where test cases has been deployed to
|
||||||
tox_dir: '{{ test_dir | realpath }}'
|
tox_dir: '{{ test_dir | realpath }}'
|
||||||
tox_command: tox
|
tox_command: '{{ tox_executable | default(tox) }}'
|
||||||
tox_environment: {}
|
tox_environment: {}
|
||||||
tox_envlist:
|
tox_envlist:
|
||||||
tox_extra_args: ''
|
tox_extra_args: ''
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
- role: tobiko-common
|
- role: tobiko-common
|
||||||
- role: tobiko-ensure-python
|
- role: tobiko-ensure-python
|
||||||
|
- role: tobiko-ensure-tox
|
||||||
|
|
Loading…
Reference in New Issue