diff --git a/lib/ansible/modules/system/authorized_key.py b/lib/ansible/modules/system/authorized_key.py index f5944a8c39..1626a5127d 100644 --- a/lib/ansible/modules/system/authorized_key.py +++ b/lib/ansible/modules/system/authorized_key.py @@ -328,7 +328,7 @@ def keyfile(module, user, write=False, path=None, manage_dir=True, follow=False) if follow: keysfile = os.path.realpath(keysfile) - if not write: + if not write or module.check_mode: return keysfile uid = user_entry.pw_uid