fix: Prevent downgrading conflicting Ansible packages in the same command #341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #340 and should work with all corner cases I can think of regarding the Ansible packages. Ubuntu's weird Ansible packaging seems to only exist on 22.04 (20.04 didn't have an
ansible-core
package, so I'm guessing it was this way for a historical reason when theansible-core
package was first being introduced); for that reason, this case handling checks the version number and only applies for the 22.04 version (for upgrades to 24.04).Testing (WIP):
ansible-core
andansible
were installed from the PPA, removesansible-core
and keepsansible
installed (fixes Fails to downgrade packages when Ansible is installed from PPA #340).ansible-core
is installed from the PPA (andansible
is not installed from anywhere), keepsansible-core
installed.ansible
depends onansible-core
, so the reverse (having the PPA'sansible
but noansible-core
) is not a possible configuration.Whenansible-core
is installed from the PPA butansible
is installed from Ubuntu, removesansible-core
.ansible-core
is installed from Ubuntu (via apt pin) butansible
is installed from the PPA, removesansible-core
.ansible
is still downgraded to the Ubuntu version, and becauseansible-core
isn't on the downgrade list, apt is able to automatically remove it.ansible-core
oransible
is installed from the Ubuntu repo (without the PPA added), keeps it installed.ansible-core
only from Ubuntuansible
only from UbuntuIn all of the cases where
ansible
was installed from any source, once on 24.04, Ubuntu'sansible-core
is installed as a dependency of Ubuntu'sansible
, because this weird Ubuntu packaging is only on 22.04. (In all cases whereansible-core
only was installed from any source, once on 24.04, onlyansible-core
is installed.)