Skip to content

Commit

Permalink
Add install python role
Browse files Browse the repository at this point in the history
  • Loading branch information
Yikun committed Aug 15, 2019
1 parent 94a99af commit 9496a26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/config-python/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
python_major_version: '3'
python_version: '3.5'
17 changes: 17 additions & 0 deletions roles/config-python/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# We can install specify version gcc/g++ in task, like this:
#- roles:
# - role: config-python
# python_major_version: '3'
# python_version: '3.5'
---
- name: Install python
shell: |
set -ex
# Install python{{ python_version }}
add-apt-repository ppa:deadsnakes/ppa -y
apt-get update
apt-get install python{{ python_version }} python{{ python_major_version }}-dev libssl-dev -y
update-alternatives --install $(which python{{ python_version }}) python{{ python_version }} $(which python{{ python_major_version }}) 1
args:
executable: /bin/bash

0 comments on commit 9496a26

Please sign in to comment.