diff --git a/roles/config-python/defaults/main.yml b/roles/config-python/defaults/main.yml new file mode 100644 index 000000000..d80a6abf4 --- /dev/null +++ b/roles/config-python/defaults/main.yml @@ -0,0 +1,3 @@ +--- +python_major_version: '3' +python_version: '3.5' diff --git a/roles/config-python/tasks/main.yml b/roles/config-python/tasks/main.yml new file mode 100644 index 000000000..4ef967db7 --- /dev/null +++ b/roles/config-python/tasks/main.yml @@ -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 \ No newline at end of file