homeserver/roles/mgrote_pip_pre_tasks/tasks/main.yml
Michael Grote e4b82dd91b
All checks were successful
ansible-lint / gitleaks (push) Successful in 3s
ansible-lint / Ansible Lint (push) Successful in 28s
Upgrade Ubuntu 22.04 to 24.04 (Inplace and Reinstall) (#200)
Reviewed-on: https://git.mgrote.net///mg/homeserver/pulls/200
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
2024-10-04 14:50:10 +02:00

15 lines
614 B
YAML

---
# Remove EXTERNALLY-MANAGED file
# Related issue: https://github.com/geerlingguy/ansible-role-pip/issues/57 + https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
- name: Get Python 3.X version
ansible.builtin.command: python3 --version
register: pyver
changed_when: false
failed_when: pyver.rc != 0
- name: Ignore PEP 668 because it's silly.
ansible.builtin.file:
state: absent
path: "/usr/lib/python{{ pyver.stdout.split()[1] | regex_search('([0-9]+\\.[0-9]+)') }}/EXTERNALLY-MANAGED"
when: pyver.stdout | regex_search('3\.[0-9]+')