From 54a28eb45b01d2f63a0ee207426f6133936737a7 Mon Sep 17 00:00:00 2001 From: drewlll2ll Date: Thu, 12 Dec 2013 09:44:29 -0500 Subject: [PATCH] Added prev_state for directory --- library/files/file | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/files/file b/library/files/file index 134b5284ef..8e2af964b9 100644 --- a/library/files/file +++ b/library/files/file @@ -307,6 +307,10 @@ def main(): if not force: module.fail_json(dest=path, src=src, msg='Cannot link, file exists at destination') changed = True + elif prev_state == 'directory': + if not force: + module.fail_json(dest=path, src=src, msg='Cannot link, directory exists at destination') + changed = True else: module.fail_json(dest=path, src=src, msg='unexpected position reached')