mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Make modify_user honor check mode on FreeBSD.
This commit is contained in:
parent
b02eb232b0
commit
c87f70429b
1 changed files with 4 additions and 0 deletions
|
@ -863,6 +863,8 @@ class FreeBsdUser(User):
|
||||||
|
|
||||||
# modify the user if cmd will do anything
|
# modify the user if cmd will do anything
|
||||||
if cmd_len != len(cmd):
|
if cmd_len != len(cmd):
|
||||||
|
if self.module.check_mode:
|
||||||
|
return (0, '', '')
|
||||||
(rc, out, err) = self.execute_command(cmd)
|
(rc, out, err) = self.execute_command(cmd)
|
||||||
if rc is not None and rc != 0:
|
if rc is not None and rc != 0:
|
||||||
self.module.fail_json(name=self.name, msg=err, rc=rc)
|
self.module.fail_json(name=self.name, msg=err, rc=rc)
|
||||||
|
@ -871,6 +873,8 @@ class FreeBsdUser(User):
|
||||||
|
|
||||||
# we have to set the password in a second command
|
# 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.update_password == 'always' and self.password is not None and info[1] != self.password:
|
||||||
|
if self.module.check_mode:
|
||||||
|
return (0, '', '')
|
||||||
cmd = [
|
cmd = [
|
||||||
self.module.get_bin_path('chpass', True),
|
self.module.get_bin_path('chpass', True),
|
||||||
'-p',
|
'-p',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue