Skip to content

Commit

Permalink
Merge pull request #1 from barnabasbusa/master
Browse files Browse the repository at this point in the history
 fix: remove EXERTNALLY-MANAGED on Debian12 geerlingguy#58
  • Loading branch information
elchusco authored Oct 13, 2023
2 parents 65c354c + 7886617 commit 9918de7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -44,17 +44,18 @@ jobs:
- rockylinux8
- fedora34
- ubuntu2004
- ubuntu1804
- debian10
- ubuntu2204
- debian11
- debian12

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'

Expand Down
12 changes: 12 additions & 0 deletions tasks/debian12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# 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
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
- 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:
name: "{{ pip_package }}"
Expand Down

0 comments on commit 9918de7

Please sign in to comment.