apt module does not mark installed packages as manually installed. #28907
Labels
affects_2.2
This issue/PR affects Ansible v2.2
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
apt
ANSIBLE VERSION
CONFIGURATION
Default configuration
OS / ENVIRONMENT
Ubuntu 14.04 (and maybe other Ubuntu versions)
SUMMARY
Packages installed by ansible's apt module may be accidentally removed later by autoremove, because ansible does not mark them as manually installed.
This can happen if an apt package was installed but marked as automatically installed before ansible was run. This usually happens if the requested package was installed as a dependency of another package.
STEPS TO REPRODUCE
This is a simplification of a larger system, but it could also represent a series of actions performed over a long period of time on the same host. These packages were chosen because their dependency structure demonstrates the issue; there is not special significance to the packages themselves.
Run
ansible-playbook
with the following playbook on Ubuntu 14.04libcaca-dev
depends onlibslang2-dev
. Installinglibcaca-dev
also installs 'libslang2-devand marks
libcaca-devas manually installed and
libslang2-dev` as automatically installed.The apt step for
libslang2-dev
does nothing, becauselibslang2-dev
is already installed (it should be marked manually installed at this point, but it isn't).The uninstall step for
libcaca-dev
uninstallslibcaca-dev
, and sinceautoremove
is specified it also removes any automatically-installed packages that are no longer needed by manually installed packages; in this case that means removinglibslang2-dev
.EXPECTED RESULTS
libslang2-dev
should be installed and marked as manually installed after running this playbook.ACTUAL RESULTS
libslang2-dev
is uninstalled by autoremove.The text was updated successfully, but these errors were encountered: