2023-03-14 22:23:33 +00:00
|
|
|
---
|
|
|
|
# task/main file for manage_pip_packages
|
2023-03-15 21:32:18 +00:00
|
|
|
- name: "Import prerequisites.yml"
|
|
|
|
ansible.builtin.include_tasks: prerequisites.yml
|
2023-03-15 22:12:05 +00:00
|
|
|
when: manage_pip_packages_install_prereqs
|
2023-03-15 21:32:18 +00:00
|
|
|
|
2023-03-16 22:36:23 +00:00
|
|
|
- name: "Install/remove required pip packages"
|
2023-03-15 21:32:18 +00:00
|
|
|
ansible.builtin.pip:
|
|
|
|
name: "{{ item.name }}{% if item.version_constraint not in [None, '', 'latest'] %}{{ item.version_constraint }}{% endif %}"
|
|
|
|
state: "{{ item.state }}"
|
2023-08-27 16:13:08 +00:00
|
|
|
extra_args: "{% if manage_pip_packages_allow_break_system_packages %}--break-system-packages{% endif %}"
|
2023-03-15 21:32:18 +00:00
|
|
|
loop: "{{ manage_pip_packages_list }}"
|
|
|
|
when: manage_pip_packages_list is defined
|
|
|
|
and manage_pip_packages_list not in [None, '']
|