geerlingguy / ansible-role-pip

Ansible Role - Pip (for Python)

Home Page:https://galaxy.ansible.com/geerlingguy/pip/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this role install python3 as well?

030 opened this issue · comments

Seems to me it should expose the executable var to really support python3 well:

http://docs.ansible.com/ansible/latest/pip_module.html

@josdotso Isn't this enough:

    - role: geerlingguy.pip
      pip_package: python3-pip

?

It does not seem to be for me

pip_package: python3-pip
pip_install_packages:
  - certbot-dns-cloudflare
failed: [web01] (item=certbot-dns-cloudflare) => {"changed": false, "item": "certbot-dns-cloudflare", "msg": "Unable to find any of pip2, pip to use.  pip needs to be installed."}
pip_package: python3-pip
which pip
[empty response]
which pip3
/usr/bin/pip3
pip_package: python-pip
which pip
/usr/bin/pip
which pip3
[empty response]

Seems it just needs a symlink if pip_package == 'python3-pip'

The above PR might not be enough to install the pip3 packages from what I just tested.

If I find something I will update the PR.

PR-15 has been updated. A much better fix.

Sorry, I don't understand why this was closed. I just used the playbook as described in the README and it fails:

fatal: [xxx]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "No package matching 'python-pip' is available"}

Setting pip_package: python3-pip results in the same error.

So either the documentation is insufficient or the README is incorrect about this not requiring any dependencies/prior steps.

Edit: seems it is related to #12