From b820de25986b12e6d8d626edcd0db325b07a012a Mon Sep 17 00:00:00 2001 From: Martin Reinhardt Date: Wed, 9 Nov 2022 09:01:51 +0100 Subject: [PATCH] fix(Python): Corrected python setup --- docker/_base/ansible/vars/main.yml | 1 + docker/ansible/ansible/vars/main.yml | 1 + docker/ansible/roles/requirements.yml | 2 +- roles/prepare/tasks/main.yml | 4 ++-- roles/prepare/vars/main.yml | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/_base/ansible/vars/main.yml b/docker/_base/ansible/vars/main.yml index 7981f37..d8d9c0d 100644 --- a/docker/_base/ansible/vars/main.yml +++ b/docker/_base/ansible/vars/main.yml @@ -2,3 +2,4 @@ pip_install_packages: - name: docker - name: mssql-cli +pip_executable: /usr/bin/pip3 diff --git a/docker/ansible/ansible/vars/main.yml b/docker/ansible/ansible/vars/main.yml index f558604..06e4531 100644 --- a/docker/ansible/ansible/vars/main.yml +++ b/docker/ansible/ansible/vars/main.yml @@ -5,3 +5,4 @@ pip_install_packages: - name: molecule - name: pyyaml - name: yamllint +pip_executable: /usr/bin/pip3 diff --git a/docker/ansible/roles/requirements.yml b/docker/ansible/roles/requirements.yml index 8085f66..9672d5e 100644 --- a/docker/ansible/roles/requirements.yml +++ b/docker/ansible/roles/requirements.yml @@ -1,3 +1,3 @@ --- - src: geerlingguy.pip - version: "2.0.0" + version: "2.2.0" diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index 4e7f33e..538c247 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -33,8 +33,8 @@ - name: Install git secret raw: git clone https://github.com/sobolevn/git-secret.git git-secret && cd git-secret && make build && PREFIX="/usr/local" make install -- name: Bootstrap python - raw: test -e /usr/bin/python || (apt-get -y update && apt-get install -y python3 && update-alternatives --install /usr/bin/python python /usr/bin/python3 1) +- name: Defaulting to python 3 + raw: update-alternatives --install /usr/bin/python python /usr/bin/python3 1 - name: Install NodeJS LTS raw: curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && apt-get install -y nodejs diff --git a/roles/prepare/vars/main.yml b/roles/prepare/vars/main.yml index 26f4546..46a0294 100644 --- a/roles/prepare/vars/main.yml +++ b/roles/prepare/vars/main.yml @@ -10,6 +10,7 @@ common_packages: - "google-cloud-sdk" - "htop" - "libxss1" + - "python3" - "python3-pip" - "python3-pkg-resources" - "python3-setuptools"