Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Change behavior of apt.py around installing recommended packages.
Browse files Browse the repository at this point in the history
Closes #1189.

This will cause the settings in Ansible to override the system settings.
That will have no effect except on systems that have an out-of-Ansible
configuration that disables automatic installation of recommended
packages.  Previously, ansible would use the OS default whenever
install_recommends wasn't part of the playbook.  This change will cause
the Ansible default configuration setting of installing recommended
packages to override the configuration files set on the OS for things
installed through ansible, even when there is no install_recommends
specified in the playbook.  Because the OS default matches the Ansible
default, this shouldn't have wide impact.
  • Loading branch information
hlieberman authored and abadger committed Nov 2, 2015
1 parent e318be3 commit baafcfc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packaging/os/apt.py
Expand Up @@ -231,7 +231,7 @@ def package_status(m, pkgname, version, cache, state):
provided_packages = cache.get_providing_packages(pkgname)
if provided_packages:
is_installed = False
# when virtual package providing only one package, look up status of target package
# when virtual package providing only one package, look up status of target package
if cache.is_virtual_package(pkgname) and len(provided_packages) == 1:
package = provided_packages[0]
installed, upgradable, has_files = package_status(m, package.name, version, cache, state='install')
Expand Down Expand Up @@ -386,7 +386,9 @@ def install(m, pkgspec, cache, upgrade=False, default_release=None,
if default_release:
cmd += " -t '%s'" % (default_release,)
if not install_recommends:
cmd += " --no-install-recommends"
cmd += " -o APT::Install-Recommends=no"
else:
cmd += " -o APT::Install-Recommends=yes"

rc, out, err = m.run_command(cmd)
if rc:
Expand Down

0 comments on commit baafcfc

Please sign in to comment.