manage_pip_packages/tasks/main.yml
Bertrand Lanson 813279acef
All checks were successful
test / Linting (push) Successful in 33s
test / Molecule tests (default, debian11) (push) Successful in 1m23s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m28s
test / Molecule tests (default, debian12) (push) Successful in 1m41s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m11s
test / Molecule tests (with_custom_packages, debian12) (push) Successful in 49s
test / Molecule tests (with_custom_packages, debian11) (push) Successful in 1m4s
test / Molecule tests (with_custom_packages, ubuntu2004) (push) Successful in 1m17s
test / Molecule tests (with_custom_packages, ubuntu2204) (push) Successful in 1m20s
added option to bypass pep668 error
2023-08-27 18:13:08 +02:00

15 lines
649 B
YAML

---
# task/main file for manage_pip_packages
- name: "Import prerequisites.yml"
ansible.builtin.include_tasks: prerequisites.yml
when: manage_pip_packages_install_prereqs
- name: "Install/remove required pip packages"
ansible.builtin.pip:
name: "{{ item.name }}{% if item.version_constraint not in [None, '', 'latest'] %}{{ item.version_constraint }}{% endif %}"
state: "{{ item.state }}"
extra_args: "{% if manage_pip_packages_allow_break_system_packages %}--break-system-packages{% endif %}"
loop: "{{ manage_pip_packages_list }}"
when: manage_pip_packages_list is defined
and manage_pip_packages_list not in [None, '']