From 573ea5bdce66370333002b6be078108a47b4a01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Sun, 22 Sep 2013 12:53:49 +0200 Subject: [PATCH] file: skip in check_mode if state=touched --- library/files/file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/files/file b/library/files/file index 7c9290ecb7d..3bda637f9a7 100644 --- a/library/files/file +++ b/library/files/file @@ -310,6 +310,9 @@ def main(): module.exit_json(dest=path, src=src, changed=changed) elif state == 'touched': + if module.check_mode: + module.exit_json(path=path, skipped=True) + if prev_state not in ['file', 'directory', 'absent']: module.fail_json(msg='Cannot touch other than files and directories') if prev_state != 'absent':