diff --git a/ansible/tasks/dev/python/pip-packages.yml b/ansible/tasks/dev/python/pip-packages.yml index b2bbca9..9e4bfa1 100644 --- a/ansible/tasks/dev/python/pip-packages.yml +++ b/ansible/tasks/dev/python/pip-packages.yml @@ -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: @@ -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 }}" @@ -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 }}" diff --git a/ansible/tasks/hello.yml b/ansible/tasks/hello.yml index 576604f..e252ced 100644 --- a/ansible/tasks/hello.yml +++ b/ansible/tasks/hello.yml @@ -7,3 +7,4 @@ msg: host: "{{ ansible_host }}" connection: "{{ ansible_connection }}" + distribution: "{{ ansible_distribution }}"