From 6567e40b6d0e5ac1a6ae3be27d59455296716424 Mon Sep 17 00:00:00 2001 From: trbs Date: Thu, 19 Jun 2014 15:47:46 +0200 Subject: [PATCH] In check mode if a symlink does not exist there is no need to check the ownership properties (which causes an exception) --- files/file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/file b/files/file index effbe6b5095..ea47811656a 100644 --- a/files/file +++ b/files/file @@ -251,6 +251,9 @@ def main(): except OSError, e: module.fail_json(path=path, msg='Error while linking: %s' % str(e)) + if module.check_mode and not os.path.exists(path): + module.exit_json(dest=path, src=src, changed=changed) + changed = module.set_fs_attributes_if_different(file_args, changed) module.exit_json(dest=path, src=src, changed=changed)