mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
apt: Run remove commands noninteractively
I'm seeing ansible hang when trying to remove a package, and the hung process is `whiptail` like in #2763. It looks like we only use `APT_ENVVARS` and `DPKG_OPTIONS` for the `apt` commands in install() and upgrade(). This change uses them in remove() as well, which fixes the hang.
This commit is contained in:
parent
56a00e0667
commit
b950f9456a
1 changed files with 1 additions and 1 deletions
|
@ -218,7 +218,7 @@ def remove(m, pkgspec, cache, purge=False):
|
|||
purge = '--purge'
|
||||
else:
|
||||
purge = ''
|
||||
cmd = "%s -q -y %s remove %s" % (APT_GET_CMD, purge,packages)
|
||||
cmd = "%s %s -q -y %s %s remove %s" % (APT_ENVVARS, APT_GET_CMD, DPKG_OPTIONS, purge, packages)
|
||||
|
||||
if m.check_mode:
|
||||
m.exit_json(changed=True)
|
||||
|
|
Loading…
Reference in a new issue