I’d like to add support for the “aptitude safe-upgrade” command in an ansible module. I was thinking of one of two options for implementing it:
Option 1: Modifying the apt module so that the “upgrade” parameter can take a new argument, e.g. “safe”: (apt: upgrade=safe). In this case, it would do “aptitude safe-upgrade -y”
Option 2: Adding a new “aptitude” module.
I’d prefer option #1, but I wanted to hear if others felt differently.
Note that the difference between “apt-get upgrade” (apt: upgrade=yes) and “aptitude safe-upgrade” is that “aptitude safe-upgrade” will install missing dependencies.
Lorin
Shouldn't this
Note that the difference between "apt-get upgrade" (apt: upgrade=yes) and
"aptitude safe-upgrade" is that "aptitude safe-upgrade" will install
missing dependencies.
be ".. will not install new dependencies"?
Serge
Why would you ever not want to install new dependencies added by a
package upgrade?
Seems like if you wanted to, you could just use the command module for
this, but it also seems very strange.
If a package goes from v1 to v2 and now requires X, it seems not
installing X is not safe in the least
safe-upgrade should be the default. regular upgrade is more of what is
used for distribution upgrades.
as per:
http://askubuntu.com/questions/117088/aptitude-safe-upgrade-equivalence-with-apt-get
The apt-get command closer to aptitude safe-upgrade is upgrade, but there
is a difference.
aptitude safe-upgrade upgrades currently installed packages and can install
new packages to resolve new dependencies, but never removes packages.
apt-get upgrade upgrades currently installed packages, but never installs
or removes packages.
So apt-get upgrade is comparable to aptitude --no-new-installs safe-upgrade.
OK, I will modify the behavior of “apt: upgrade=yes” to use “aptitude safe-upgrade” instead of “apt-get upgrade”
Lorin
Shouldn't this
Note that the difference between "apt-get upgrade" (apt: upgrade=yes) and
"aptitude safe-upgrade" is that "aptitude safe-upgrade" will install
missing dependencies.
be ".. will not install new dependencies"?
No, it's correct. "aptitude safe-upgrade" installs missing dependencies,
and "apt-get upgrade" doesn't. You pretty much always want to install
missing dependencies if an updated package requires a new dependency, so
"aptitude safe-upgrade" is the common case.
Lorin
This is merged now.
As we are scheduled to release 1.1 tomorrow, if everyone can test the
app module today that would be greatly appreciated!
How would this run for systems which only have apt-get installed and not aptitude?
(A) You could of course install aptitude.
(B) I think the real question you meant to ask was 'can we do this
with apt instead', which is my question.
Though it will need to wait until 1.2.