diff --git a/lib/ansible/modules/files/file.py b/lib/ansible/modules/files/file.py index 9f1ab945dc..ff1baca2ce 100644 --- a/lib/ansible/modules/files/file.py +++ b/lib/ansible/modules/files/file.py @@ -238,6 +238,7 @@ def main(): if follow and state == 'link': # use the current target of the link as the source src = to_native(os.path.realpath(b_path), errors='strict') + b_src = to_bytes(os.path.realpath(b_path), errors='strict') else: module.fail_json(msg='src and dest are required for creating links')