Skip to content

Commit

Permalink
chore: pip
Browse files Browse the repository at this point in the history
  • Loading branch information
labasubagia committed Jul 19, 2024
1 parent 55dd2ba commit b70d0a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ansible/tasks/dev/python/pip-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
path: "{{ pip_executable }}"
register: pip

- name: Setup pip > set facts
ansible.builtin.set_fact:
pip_extra_args:
- "{{ '--break-system-packages' if ansible_distribution == 'Debian' else '' }}"

- name: Setup pip > executable exists
when: pip.stat.exists
block:
Expand All @@ -25,7 +30,7 @@
ansible.builtin.pip:
name: "{{ pip_pkgs }}"
# break_system_packages: true # only ansible >=v2.17
extra_args: --break-system-packages
extra_args: "{{ pip_extra_args | join(' ') }}"
state: present
executable: "{{ pip_executable }}"

Expand All @@ -36,6 +41,6 @@
ansible.builtin.pip:
name: "{{ pip_pkgs }}"
# break_system_packages: true # only ansible >=v2.17
extra_args: --break-system-packages
extra_args: "{{ pip_extra_args | join(' ') }}"
state: absent
executable: "{{ pip_executable }}"
1 change: 1 addition & 0 deletions ansible/tasks/hello.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
msg:
host: "{{ ansible_host }}"
connection: "{{ ansible_connection }}"
distribution: "{{ ansible_distribution }}"

0 comments on commit b70d0a7

Please sign in to comment.