diff --git a/library/packaging/apt b/library/packaging/apt index d0e86e80827..37856074c96 100644 --- a/library/packaging/apt +++ b/library/packaging/apt @@ -210,9 +210,10 @@ def remove(m, pkgspec, cache, purge=False): if len(packages) == 0: m.exit_json(changed=False) else: - purge = '' if purge: purge = '--purge' + else: + purge = '' cmd = "%s -q -y %s remove %s" % (APT_GET_CMD, purge,packages) if m.check_mode: