From b5c9945485d80cb3ab73aa1c831e83a4338110e9 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 9 Feb 2016 21:48:01 -0500 Subject: [PATCH] avoid chmod in check mode --- lib/ansible/modules/system/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index 147e434b5e..1b66710ca2 100755 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -608,7 +608,7 @@ class User(object): cmd.append('') (rc, out, err) = self.execute_command(cmd) - if rc == 0: + if rc == 0 and not self.module.check_mode: # If the keys were successfully created, we should be able # to tweak ownership. os.chown(ssh_key_file, info[2], info[3])