-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ubuntu-latest has broken pre-installed ansible tool (please remove) #3001
Comments
I bet this problem is not specific to the Ansible package — Debian derivatives are known to ignore the existence of virtualenvs: https://gist.github.com/tiran/2dec9e03c6f901814f6d1e8dad09528e#gistcomment-3674863 |
Have you checked if Ubuntu's |
Yes, I can confirm that the broken Ubuntu one, is using While the env based shebang may be seen as portable and prefered for standalone scripts, it is clearly not a good idea for tools that rely on external libraries, as virtualenv activation will likely break those tools as they will endup calling another python interpreter, one that does not have access to their dependencies. |
Hey, @ssbarnea
|
I would recommend to keep the tool in PATH while doing the swap from distro ansible to pip(x)-ansible. Keep in mind that by default Ubuntu does not have pipx could be one path for sure, I started using it only recently so I am not yet sure how well it works on each platform and if there are hidden surprises to be expected. My old approach was to using If we install Ansible from another location but is not found in default PATH, or if activation of a virtualenv is required, we degrade the UX for some users. If GHA team would agree to make the already documented workaround of |
I don't think it makes sense to store both versions due to the
A user and user's home directory at the end of generation process is deleted.
The |
@ssbarnea just fyi: we're going to add |
@ssbarnea,We are planning to switch installation approach from |
@ssbarnea , The new image with ansible from pipx has been deployed. |
In switching from
I was able to resolve my range of broken workflows, by injecting those two packages into the Ansible virtual environment via an additional step:
|
Yes, that is the price we have to pay for using pipx, I am aware of it. Mainly what pipx does is that it hides the management of the virtualenv used for installing these commands. Still, when you want to add extra dependencies, you need to do it like this. |
Feel free to open the thread if you have any concerns. |
Description
The preinstalled ansible on GHA is broken because it cannot be called from within an activated python virtualenvs. The root cause is a broken DEB package but pre-installing it is doing more damage.
Area for Triage:
Question, Bug, or Feature?:
Virtual environments affected
Image version
all ubuntu images
Expected behavior
Actual behavior
Please note that installing ansible using
pip
orpipx
at--user
or even root level does install a working copy of ansible, one that works regardless if a virtualenv is active or not.As a first step, please remove the broken copy.
This bug impacts the testing of Python based projects where 99% are using virtualenvs for testing, likely with tox.
The text was updated successfully, but these errors were encountered: