From 795b71139446ddd5348d829fd860967e6e14ae63 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 15 Sep 2018 15:41:00 +0200 Subject: [PATCH] Do not reset permissions in checkmode If using authorized_key on a directory with non standard permissions, using checkmode will reset the permission silently. --- lib/ansible/modules/system/authorized_key.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/authorized_key.py b/lib/ansible/modules/system/authorized_key.py index f5944a8c391..1626a5127d8 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