ansible / ansible-dev-tools

Ansible automation developer tools
https://ansible.readthedocs.io/projects/dev-tools/
GNU General Public License v3.0
85 stars 29 forks source link

no link to pip, pip3 is OK #482

Open marek-mikolajczyk opened 1 week ago

marek-mikolajczyk commented 1 week ago

Hello

I've started using ansible-dev-tools recently, and found pip3 works well, but link to pip is not present:

---
- name: Get EE info
  hosts: localhost

  tasks:
  - name: list ansible collections
    shell: ansible-galaxy collection list

  - name: list python packages
    shell: pip list        

Then, the playbook will fail:

TASK [list python packages] ****************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "pip list", "delta": "0:00:00.003125", "end": "2024-11-19 10:10:44.214065", "msg": "non-zero return code", "rc": 127, "start": "2024-11-19 10:10:44.210940", "stderr": "/bin/sh: line 1: pip: command not found", "stderr_lines": ["/bin/sh: line 1: pip: command not found"], "stdout": "", "stdout_lines": []}

I've added a step for building my EE:

additional_build_steps:
   append_final:
    - RUN ln -s /usr/local/bin/pip3 /usr/local/bin/pip

Is this the right way? Is it an useful finding for you?