ansible-consul icon indicating copy to clipboard operation
ansible-consul copied to clipboard

pip netaddr

Open lilithfr opened this issue 6 years ago • 11 comments

The first task generates an error on my environment (minimal Debian) The pip package netaddr was not installed and using the flag "become: false" generate a failure due of the permission. I had to add the option "extra_args: --user" in order to make it work.

  • name: Install netaddr dependency locally pip: name: netaddr extra_args: --user delegate_to: 127.0.0.1 become: false

lilithfr avatar Dec 01 '17 03:12 lilithfr

Hi,

Thanks for using the role and reporting this. It will be fixed shortly.

brianshumate avatar Dec 01 '17 04:12 brianshumate

This is now fixed in v1.29.0

brianshumate avatar Dec 01 '17 04:12 brianshumate

FYI when using a virtualenv as one might with something like Molecule, this will cause the role to fail:

    TASK [brianshumate.consul : Install netaddr dependency on controlling host as user] ***
    fatal: [xenial -> 127.0.0.1]: FAILED! => {"changed": false, "cmd": "/Users/phil/.pyenv/versions/ansible/bin/pip2 install --user netaddr", "msg": "\n:stderr: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.\n"}

gaahrdner avatar Jan 08 '18 21:01 gaahrdner

Hey @gaahrdner! Thanks for the heads up!

I fixed this with a conditional --user based on the VIRTUAL_ENV environment variable in 8bb22b6d28bc25157fec58ee5d16a254e5d62c03.

brianshumate avatar Jan 09 '18 15:01 brianshumate

Hi, just a question for my understanding, why do we need to install something on our workstation?

My playbook fail because of this first task, becase I created a playbook that use a dedicated sudo user with become: true and the sudo password used for the cluster is not the same as my local user.

Sispheor avatar May 02 '18 14:05 Sispheor

Ok it is used by the local controller machine to be able to use the filter map('ipwrap').

Sispheor avatar May 02 '18 14:05 Sispheor

Yes, it's just a convenience thing that was added to deal with IPs

brianshumate avatar May 03 '18 17:05 brianshumate

It is not usable with a playbook that use sudo with password. Beause the sudo password is never the same between our workstation and target servers You should document the requirement and ask the user to have this lib installed instead or add a tag to skip with first task.

Sispheor avatar May 04 '18 07:05 Sispheor

I agree with @Sispheor that we should not install stuff on the local machine by default. Using an opt-in flag could be a good middle ground. (Never really liked this)

groggemans avatar May 04 '18 08:05 groggemans

Agree that it's less than ideal. If the IP handling can be done without it, I'd be happy to see it removed.

brianshumate avatar May 04 '18 14:05 brianshumate

Does anyone want to work on making the role work without netaddr?

brianshumate avatar Jul 06 '18 21:07 brianshumate