summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2016-01-31 02:51:34 -0800
committernitzmahone <mdavis@ansible.com>2016-02-10 22:27:02 -0800
commit61872ece5795ea0ddfb06505966d5bc5326ed338 (patch)
tree2a63f1710b571283a2b974da76a9d352e30e17ad
parentc9c9572ae855ac5f1906f931aeb21abbdb10411f (diff)
downloadansible-modules-core-61872ece5795ea0ddfb06505966d5bc5326ed338.tar.gz
Do not install python-apt in check mode.
-rwxr-xr-xpackaging/os/apt.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/packaging/os/apt.py b/packaging/os/apt.py
index 8e4be1a6..774aa866 100755
--- a/packaging/os/apt.py
+++ b/packaging/os/apt.py
@@ -560,6 +560,8 @@ def main():
module.run_command_environ_update = APT_ENV_VARS
if not HAS_PYTHON_APT:
+ if module.check_mode:
+ module.fail_json(msg="python-apt must be installed to use check mode")
try:
module.run_command('apt-get update && apt-get install python-apt -y -q --force-yes', use_unsafe_shell=True, check_rc=True)
global apt, apt_pkg