mirror of
https://github.com/geerlingguy/ansible-role-pip.git
synced 2025-01-13 19:31:25 +01:00
Merge pull request #69 from ShaneMcC/issue-66
Fix for externally-managed python on later ubuntu/debian installs.
This commit is contained in:
commit
5b1f472d72
@ -1,13 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
changed_when: false
|
||||
|
||||
- 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
|
@ -1,15 +1,14 @@
|
||||
---
|
||||
- name: Remove externally managed from Debian 12
|
||||
ansible.builtin.import_tasks: debian12.yml
|
||||
when:
|
||||
- ansible_distribution == "Debian"
|
||||
- ansible_distribution_major_version|int >= 12
|
||||
|
||||
- name: Ensure Pip is installed.
|
||||
package:
|
||||
name: "{{ pip_package }}"
|
||||
state: present
|
||||
|
||||
- name: Remove EXTERNALLY-MANAGED
|
||||
ansible.builtin.file:
|
||||
path: /usr/lib/python3.{{ ansible_python.version.minor }}/EXTERNALLY-MANAGED
|
||||
state: absent
|
||||
|
||||
- name: Ensure pip_install_packages are installed.
|
||||
pip:
|
||||
name: "{{ item.name | default(item) }}"
|
||||
|
Loading…
Reference in New Issue
Block a user