From 8fe3b0526298c26af0f954e542cc9508b87cb5e9 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 --- files/file | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/file b/files/file index 134b5284efd..8e2af964b9d 100644 --- a/files/file +++ b/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')