Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PEP 668 disallows installing packages via pip outside of virtual environments, to avoid breaking due to conflicting system packages. Ansible is unlikely to be installed in the base system, and if it is and the user still chooses to use `install_method: pip`, that would be an invalid configuration. This flag exists to allow users to bootstrap ansible to run as a controller. The alternative solution would be to require virtual environments, however this is often packaged as a separate dependency, which further complicates bootstrap. Allow installing ansible outside of virtual environments via pip's --break-system-packages. Fixes GH-4244
- Loading branch information
b417b21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been using cloud-init's Ansible module for some time. This change appears to have broken the module, at least for us. Using Ubuntu's standard cloud images, we have:
Ubuntu 20.04 - Python 3.8
Ubuntu 22.04 - Python 3.10.12 (pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10))
In neither case is the switch
--break-system-packages
available.I suspect that the version of pip should be checked?
b417b21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to hear it. I hope it has been working well for you other than this bug?
Which version of cloud-init?
Correct, this was fixed in 13938f7.
In any case, if you have a bug to report, please report it.
b417b21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my earlier terseness, it had been a long day.
Yes, it works well indeed. The only gripe we have is that we already have Ansible installed in our image, so alongside
pip
anddistro
it would be nice to see a third option install_methodextant
. I don't think it is possible to not specify this parameter?These are the versions of cloud-init, python and pip we have installed (after a full apt-upgrade):
I tried updating pip, but somehow that is pinned by Canonical to the system package.
I'm currently trying an image with cloud-init 23.1.2, which I think is both available and doesn't have this change in.