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

Parameters are mutually exclusive: executable|virtualenv

dmotte opened this issue Β· comments

commented

Hi. First of all, thanks a lot for this role πŸ˜‰ it's very useful

Using geerlingguy.pip role version: 2.2.0

Using Ansible core version 2.14.2

My Ansible task:

- name: Install some pip packages
  ansible.builtin.include_role: { name: geerlingguy.pip }
  vars:
    ansible_become: true
    pip_install_packages:
      - name: glances==3.*
        virtualenv: /opt/venv01

What I get:

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] ************
failed: [default] (item={'name': 'glances==3.*', 'virtualenv': '/opt/venv01'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "glances==3.*", "virtualenv": "/opt/venv01"}, "msg": "parameters are mutually exclusive: executable|virtualenv"}

I believe the error is at: https://github.com/geerlingguy/ansible-role-pip/blob/master/tasks/main.yml#L14

Maybe the executable task parameter should be changed to "{{ pip_executable | default(omit) }}" and the pip_executable variable should be unset by default? Don't know, just proposing something

commented

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

Would like to reopen this as that's still a problem.

Using this:

- role: geerlingguy.pip
      vars:
        pip_install_packages:
          - name: docker
            virtualenv: /opt/python/venv

Still gives that message:
ASK [geerlingguy.pip : Ensure pip_install_packages are installed.] ******************************************************************************************************************* failed: [urbackup] (item={'name': 'docker', 'virtualenv': '/opt/python/venv'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "docker", "virtualenv": "/opt/python/venv"}, "msg": "parameters are mutually exclusive: executable|virtualenv"}

Could the proposed fix pls be implemented?

JFI, I ended up not using this role anymore and using ansible.builtin.pip directly instead

I'd be okay with merging a fix if someone submits a PR, the key is I would like to make sure it doesn't break any existing installs.

I can give this a try πŸ˜‰ I will provide a PR

I would like to make sure it doesn't break any existing installs

Got it. I'll be careful