Add ensure-python role

ensure-python allows for installation of a specific version of
the python interpreter and development files. Add this role to
tox pre.yaml.

Change-Id: Ia56cba58c87aa48de3e8e3f3d28f6252f7dcd7c3
This commit is contained in:
Corey Bryant 2018-10-11 12:38:23 -04:00
parent 055b96d5d7
commit 42cf8e680a
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,4 @@
- hosts: all
roles:
- ensure-tox
- ensure-python

View File

@ -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``.

View File

@ -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