From 8bb538aeb13872e6bcec142bbf40ddf0e6478a9f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 3 Feb 2016 02:24:12 -0800 Subject: [PATCH] Make modify_user honor check mode on FreeBSD. --- system/user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/user.py b/system/user.py index 07ad015a561..29d84bf7c13 100755 --- a/system/user.py +++ b/system/user.py @@ -864,6 +864,8 @@ class FreeBsdUser(User): # modify the user if cmd will do anything if cmd_len != len(cmd): + if self.module.check_mode: + return (0, '', '') (rc, out, err) = self.execute_command(cmd) if rc is not None and rc != 0: self.module.fail_json(name=self.name, msg=err, rc=rc) @@ -872,6 +874,8 @@ class FreeBsdUser(User): # we have to set the password in a second command if self.update_password == 'always' and self.password is not None and info[1] != self.password: + if self.module.check_mode: + return (0, '', '') cmd = [ self.module.get_bin_path('chpass', True), '-p',