Skip to content

Commit b04926d

Browse files
committed
a ppa derived python is fine too
1 parent 95dac2c commit b04926d

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ python_source_version: "2.7.6"
1313
python_source_configure_options: "--prefix={{python_prefix_dir}}"
1414

1515
get_pip_url: "https://bootstrap.pypa.io/get-pip.py"
16+
17+
python_versions: []

tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
- name: "Get the distribution specific variables"
33
include_vars: "{{ansible_distribution|lower}}-{{ansible_distribution_version}}.yml"
4+
45
- include_tasks: "package.yml"
6+
57
- include_tasks: "pip.yml"
8+
69
- include_tasks: "virtualenv.yml"

tasks/package.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
2+
- name: "Make sure PPA is enabled"
3+
apt_repository:
4+
repo: "ppa:deadsnakes/ppa"
5+
mode: "0644"
6+
27
- name: "Make sure the packages are installed"
38
apt:
49
pkg: "{{python_packages_add}}"
5-
state: "present"
10+
state: "latest"
611
update_cache: true
712
when: python_packages_add|default([])|length > 0
813

@@ -11,3 +16,13 @@
1116
pkg: "{{python_packages_remove}}"
1217
state: "absent"
1318
when: python_packages_remove|default([])|length > 0
19+
20+
- name: "install additional python versions, if requested"
21+
apt:
22+
pkg:
23+
- "python{{item}}"
24+
- "python{{item}}-distutils"
25+
- "python{{item}}-dev"
26+
- "python{{item}}-venv"
27+
state: "latest"
28+
with_items: "{{python_versions}}"

0 commit comments

Comments
 (0)