From 2aef145841e1dd155ba490b5db14a88ee61df1c8 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Aug 2023 15:22:46 +0200 Subject: [PATCH 1/5] 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 }}" From 088273d11bcf13f98af9e33db91fc85dec05994d Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 11 Aug 2023 10:24:46 +0200 Subject: [PATCH 2/5] move the external managed task into a subtask, update ci to run newer images --- .github/workflows/ci.yml | 5 +++-- tasks/debian12.yml | 11 +++++++++++ tasks/main.yml | 17 +++++------------ 3 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 tasks/debian12.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 136501c..025e752 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,9 @@ jobs: - rockylinux8 - fedora34 - ubuntu2004 - - ubuntu1804 - - debian10 + - ubuntu2204 + - debian11 + - debian12 steps: - name: Check out the codebase. diff --git a/tasks/debian12.yml b/tasks/debian12.yml new file mode 100644 index 0000000..1284a91 --- /dev/null +++ b/tasks/debian12.yml @@ -0,0 +1,11 @@ +# 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 + +- name: Remove EXTERNALLY-MANAGED + ansible.builtin.file: + path: /usr/lib/python3.11/EXTERNALLY-MANAGED + state: absent + when: py3ver is defined and py3ver.stdout.find("3.11") != -1 \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 1761992..dcdbd13 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,16 +1,9 @@ --- -# 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: Remove externally managed from Debian 12 + ansible.builtin.import_tasks: debian12.yml + when: + - ansible_distribution == "Debian" + - ansible_distribution_version == "12" - name: Ensure Pip is installed. package: From 12de34e3a985e709868f3262aeed26541c2d6cd6 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 11 Aug 2023 10:27:36 +0200 Subject: [PATCH 3/5] fix yamllint --- tasks/debian12.yml | 3 ++- tasks/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/debian12.yml b/tasks/debian12.yml index 1284a91..ff2f280 100644 --- a/tasks/debian12.yml +++ b/tasks/debian12.yml @@ -1,3 +1,4 @@ +--- # 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 @@ -8,4 +9,4 @@ ansible.builtin.file: path: /usr/lib/python3.11/EXTERNALLY-MANAGED state: absent - when: py3ver is defined and py3ver.stdout.find("3.11") != -1 \ No newline at end of file + when: py3ver is defined and py3ver.stdout.find("3.11") != -1 diff --git a/tasks/main.yml b/tasks/main.yml index dcdbd13..8959e97 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,8 @@ --- - name: Remove externally managed from Debian 12 ansible.builtin.import_tasks: debian12.yml - when: - - ansible_distribution == "Debian" + when: + - ansible_distribution == "Debian" - ansible_distribution_version == "12" - name: Ensure Pip is installed. From 9de8ba5c86a608c993b0c04141be489a60a3370c Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 11 Aug 2023 10:32:40 +0200 Subject: [PATCH 4/5] bump actions versions, as they dropping support soon --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 025e752..56d6b2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,12 +50,12 @@ jobs: steps: - name: Check out the codebase. - uses: actions/checkout@v2 + uses: actions/checkout@v3.5.3 with: path: 'geerlingguy.pip' - name: Set up Python 3. - uses: actions/setup-python@v2 + uses: actions/setup-python@v4.7.0 with: python-version: '3.x' From 7886617de5ba8d4f0bb2a361626ab4c82227dd5f Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 11 Aug 2023 10:34:25 +0200 Subject: [PATCH 5/5] bump actions versions, as they dropping support soon --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56d6b2f..7588cdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the codebase. - uses: actions/checkout@v2 + uses: actions/checkout@v3.5.3 with: path: 'geerlingguy.pip' - name: Set up Python 3. - uses: actions/setup-python@v2 + uses: actions/setup-python@v4.7.0 with: python-version: '3.x'