diff --git a/playbooks/tox/pre.yaml b/playbooks/tox/pre.yaml index 69e7def02..87e13883d 100644 --- a/playbooks/tox/pre.yaml +++ b/playbooks/tox/pre.yaml @@ -1,3 +1,4 @@ - hosts: all roles: - ensure-tox + - ensure-python diff --git a/roles/ensure-python/README.rst b/roles/ensure-python/README.rst new file mode 100644 index 000000000..029398029 --- /dev/null +++ b/roles/ensure-python/README.rst @@ -0,0 +1,10 @@ +Ensure specified python interpreter and development files are installed + +.. note:: This role is only available for Debian based platforms + currently. + +**Role Variables** + +.. zuul:rolevar:: python_version + + Optional version of python interpreter to install, such as ``3.7``. diff --git a/roles/ensure-python/tasks/main.yaml b/roles/ensure-python/tasks/main.yaml new file mode 100644 index 000000000..7b3a59487 --- /dev/null +++ b/roles/ensure-python/tasks/main.yaml @@ -0,0 +1,6 @@ +- name: Install specified version of python interpreter and development files + when: python_version is defined + package: + name: python{{ python_version }}-dev + state: present + become: yes