From 2e52f017eef6ed3ab2d3e1cc089d2508e4e05a01 Mon Sep 17 00:00:00 2001 From: Samim Mirhosseini Date: Sun, 25 Nov 2018 22:36:09 -0500 Subject: [PATCH] feat: Add python3.6 Bakelet --- lang/python/python3.6.yml | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lang/python/python3.6.yml diff --git a/lang/python/python3.6.yml b/lang/python/python3.6.yml new file mode 100644 index 00000000..3923fb67 --- /dev/null +++ b/lang/python/python3.6.yml @@ -0,0 +1,58 @@ +- hosts: all + become: yes + tasks: + + - name: Install basic utils and build envs. + apt: pkg={{ item }} state=present + with_items: + - git + - unzip + - vim + - build-essential + + - name: add ppa for python 3.6 + apt_repository: repo='ppa:deadsnakes/ppa' state=present + + - name: Install required system packages. + apt: pkg={{ item }} state=present + with_items: + - python3.6 + - python3.6-dev + - python3.6-venv + + - name: Set python3.6 as default python using alternatives + alternatives: + name: python + link: /usr/bin/python + path: /usr/bin/python3.6 + + - name: Get pip + get_url: + url: https://bootstrap.pypa.io/get-pip.py + dest: /tmp/get-pip.py + + - name: Install pip3.6 + become: yes + command: python3.6 /tmp/get-pip.py + + - name: Set pip3.6 as default pip using alternatives + alternatives: + name: pip + link: /usr/bin/pip + path: /usr/local/bin/pip3.6 + + - name: Upgrade pip + pip: + name: pip + executable: pip3.6 + extra_args: --upgrade + + - stat: path="{{BAKER_SHARE_DIR}}/requirements.txt" + register: file_exists + + - name: Install the project requirements + pip: + state: present + executable: pip3.6 + requirements: "{{BAKER_SHARE_DIR}}/requirements.txt" + when: file_exists.stat.exists == True