Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip netaddr #129

Open
lilithfr opened this issue Dec 1, 2017 · 11 comments
Open

pip netaddr #129

lilithfr opened this issue Dec 1, 2017 · 11 comments

Comments

@lilithfr
Copy link

lilithfr commented Dec 1, 2017

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
@brianshumate
Copy link
Contributor

Hi,

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

@brianshumate
Copy link
Contributor

This is now fixed in v1.29.0

@gaahrdner
Copy link

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"}

brianshumate added a commit that referenced this issue Jan 9, 2018
- Add performance tuning configuration (thanks @t0k4rt)
- Update documentation
- Conditionally install Python dependency baed on virtualenv or --user
  Addresses #129 (comment)
@brianshumate
Copy link
Contributor

Hey @gaahrdner! Thanks for the heads up!

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

brianshumate added a commit that referenced this issue Jan 11, 2018
- Add performance tuning configuration (thanks @t0k4rt)
  - Set raft multiplier to 1
- Conditionally install Python dependency baed on virtualenv or --user
  Addresses #129 (comment)
- Update includes to import_tasks and include_tasks
- Remove invalid consul_version key from configuration
- Update Vagrantfile
  - Set client address to 0.0.0.0 so Vagrant based deploy checks now pass
- Update documentation
@Sispheor
Copy link
Contributor

Sispheor commented May 2, 2018

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
Copy link
Contributor

Sispheor commented May 2, 2018

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

@brianshumate
Copy link
Contributor

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

@Sispheor
Copy link
Contributor

Sispheor commented May 4, 2018

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.

@groggemans
Copy link

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)

@brianshumate
Copy link
Contributor

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
Copy link
Contributor

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

@brianshumate brianshumate reopened this Jul 6, 2018
msherman13 added a commit to msherman13/ansible-consul that referenced this issue Oct 27, 2023
this only supports ipv4 addresses, i don't know if the
client address can even be ipv6 but please confirm if so

addresses issue 129:
ansible-collections#129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants