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

fix: Prevent downgrading conflicting Ansible packages in the same command #341

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jacobgkau
Copy link
Member

@jacobgkau jacobgkau commented Nov 8, 2024

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 the ansible-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):

  • When ansible-core and ansible were installed from the PPA, removes ansible-core and keeps ansible installed (fixes Fails to downgrade packages when Ansible is installed from PPA #340).
  • When only ansible-core is installed from the PPA (and ansible is not installed from anywhere), keeps ansible-core installed.
    • The PPA's ansible depends on ansible-core, so the reverse (having the PPA's ansible but no ansible-core) is not a possible configuration.
  • When ansible-core is installed from the PPA but ansible is installed from Ubuntu, removes ansible-core.
    • Not a possible configuration due to file conflicts.
  • When ansible-core is installed from Ubuntu (via apt pin) but ansible is installed from the PPA, removes ansible-core.
    • Works because ansible is still downgraded to the Ubuntu version, and because ansible-core isn't on the downgrade list, apt is able to automatically remove it.
  • When either ansible-core or ansible is installed from the Ubuntu repo (without the PPA added), keeps it installed.
    • ansible-core only from Ubuntu
    • ansible only from Ubuntu
    • The 22.04 Ubuntu repo doesn't allow installing both at once.
  • Upgrade with neither package installed still succeeds.

In all of the cases where ansible was installed from any source, once on 24.04, Ubuntu's ansible-core is installed as a dependency of Ubuntu's ansible, because this weird Ubuntu packaging is only on 22.04. (In all cases where ansible-core only was installed from any source, once on 24.04, only ansible-core is installed.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to downgrade packages when Ansible is installed from PPA
1 participant