ensure-python: pull in venv package on Debuntu

When installing from packages on Debuntu, also bring in the
python<version>-venv package as a base dependency.

Change-Id: Ie3c03fea82bcec80a897f0905c15f35405a50396
This commit is contained in:
Ian Wienand 2022-07-26 10:18:49 +10:00
parent a46b34b9f7
commit 02b8b63d09
1 changed files with 16 additions and 1 deletions

View File

@ -16,7 +16,22 @@
when:
- ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
package:
name: python{{ python_version }}-dev
name:
- 'python{{ python_version }}-dev'
state: present
become: yes
# Ubuntu splits out the venv package, which is really the only
# sane way to use a non-default-but-packaged version of python on
# your system (i.e. via virtual environments setup with python<v>
# -m venv). Pull it in by default for python3.
- name: Pull in venv package
when:
- ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- python_version is version('3', '>')
package:
name:
- 'python{{ python_version }}-venv'
state: present
become: yes