ansible-consul
ansible-consul copied to clipboard
pip netaddr
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
Hi,
Thanks for using the role and reporting this. It will be fixed shortly.
This is now fixed in v1.29.0
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"}
Hey @gaahrdner! Thanks for the heads up!
I fixed this with a conditional --user
based on the VIRTUAL_ENV
environment variable in 8bb22b6d28bc25157fec58ee5d16a254e5d62c03.
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.
Ok it is used by the local controller machine to be able to use the filter map('ipwrap')
.
Yes, it's just a convenience thing that was added to deal with IPs
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.
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)
Agree that it's less than ideal. If the IP handling can be done without it, I'd be happy to see it removed.
Does anyone want to work on making the role work without netaddr?