From 2aef145841e1dd155ba490b5db14a88ee61df1c8 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Aug 2023 15:22:46 +0200 Subject: [PATCH] fix: remove EXERTNALLY-MANAGED on Debian12 --- tasks/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index e2e8aa1..1761992 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,17 @@ --- +# Remove EXTERNALLY-MANAGED file if we're on Debian12 +# Related issue: https://github.com/geerlingguy/ansible-role-pip/issues/57 +- name: get python3 version installed + ansible.builtin.command: python3 --version + register: py3ver + when: ansible_distribution == "Debian" and ansible_distribution_version == "12" + +- name: remove EXTERNALLY-MANAGED if we're on debian12 + ansible.builtin.file: + path: /usr/lib/python3.11/EXTERNALLY-MANAGED + state: absent + when: py3ver is defined and py3ver.stdout.find("3.11") != -1 + - name: Ensure Pip is installed. package: name: "{{ pip_package }}"