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
ansible_local's pip installer has a hardcoded curl get_pip.py piped to python #9584
Comments
@chadswen Thank you for reporting this use case. The (Ansible) provisioners are not aiming at supporting any use case, and for "advanced/complex" situations we try to find the adequate balance (code complexity, ROI, Vagrant flexibility for customization, etc.).
Running behind a proxy is typically subject to variance and somehow hard to fully cover by relying on standard configuration capabilities (for instance the Docker provisioner also installs with hardcoded So, you did the right thing with implementing your own ansible setup via a shell provisioner:
Now, to avoid this useless and annoying wait, you can extend your shell provisioner to also install ansible, and then configure the Please let me know if this solution works for you and if you agree to close this issue (i.e. no feature request). Thanks! |
@gildegoma I'd hate to stop using the ansible installer. It installs the specific version of ansible as required by my playbook and that feature saves me from rewriting a fair amount of code with a shell provisioner. My only problem is that there is no way to set args when ansible_local installs pip before it installs ansible. I can set args just fine when it installs ansible using |
The issue is quite clear to me, and I do appreciate that the existing features are used ;-)
I guess it shouldn't be that large (e.g. @chadswen what would be your proposal to resolve this? I would propose to introduce a new |
@gildegoma That solution would work quite well. I can't volunteer to work on it right now, but perhaps in the future if it isn't picked up. Thanks! |
* commit 'cd3909d7cede3a58a2b3439add3f8cb53a770919': Update CHANGELOG Update CHANGELOG Update CHANGELOG Move up doc string for `vagrant snapshot pop` Ensure non-existent machines do not attempt to list snapshots Do not rely on IPAddr#prefix as it's not available on older rubies Update guest capabilities for coreos Fixing bug I introduced. Thanks @chrisroberts! Updated based on recommended changes per review. Updated documentation. Fixes hashicorp#9584. Handling the cases for UNSET_VALUE, i.e., config is not finalized. Config has pip_install_cmd for Provisioner to pick it up. Tests updated. Ubuntu code updated because it calls Debian code. Exposing pip_install_cmd to callers as optional. Handling empty strings passed as pip_install_command. Adding pip_install_cmd as a default parameter to get_pip. Unit Tests.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When the
ansible_local
provisioner configuresansible.install_mode = pip
this command is invoked:vagrant/plugins/provisioners/ansible/cap/guest/pip/pip.rb
Line 23 in cb61497
Piping curl into python with a static command prevents me from setting get_pip.py args. In my case I need to set a proxy, but I don't want to set a proxy for the entire provisioner as that causes issues when running certain playbooks. As far as I can tell there's no way to set a proxy for only the ansible install phase of the provisioner.
As a workaround, I use a shell provisioner to install pip manually with my custom get_pip.py args before
ansible_local
runs, but I still have to wait foransible_local
's static curl | python command to timeout on every install which is fairly annoying. I would use the package manger ansible install_mode, but my ansible playbooks require specific ansible versions and you can only target an ansible version with the pip install_mode.Vagrant version
Vagrant 2.0.2
The text was updated successfully, but these errors were encountered: