From 80a5500a2315c97f35ebf7617ca37edf4bc85237 Mon Sep 17 00:00:00 2001 From: sysadmin75 Date: Fri, 23 Jan 2015 18:10:00 -0500 Subject: [PATCH] Fix #10059 - replace module does not obey follow=yes --- files/replace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/replace.py b/files/replace.py index b7b75a9604d..588af02391e 100644 --- a/files/replace.py +++ b/files/replace.py @@ -152,6 +152,8 @@ def main(): if changed and not module.check_mode: if params['backup'] and os.path.exists(dest): module.backup_local(dest) + if params['follow'] and os.path.islink(dest): + dest = os.path.realpath(dest) write_changes(module, result[0], dest) msg, changed = check_file_attrs(module, changed, msg)