MajesticMagikarpKing 2 weeks ago committed by GitHub
commit ef59bba3e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- fixed the issue of creating user directory using tilde(~) always reported "changed".(https://github.com/ansible/ansible/issues/82490)

@ -74,7 +74,8 @@ options:
Since Ansible 2.5, the default shell for non-system users on macOS is V(/bin/bash).
- On other operating systems, the default shell is determined by the underlying tool
invoked by this module. See Notes for a per platform list of invoked tools.
type: str
- From Ansible 2.18, the type is changed to I(path) from I(str).
type: path
home:
description:
- Optionally set the user's home directory.
@ -3115,7 +3116,7 @@ def main():
groups=dict(type='list', elements='str'),
comment=dict(type='str'),
home=dict(type='path'),
shell=dict(type='str'),
shell=dict(type='path'),
password=dict(type='str', no_log=True),
login_class=dict(type='str'),
password_expire_max=dict(type='int', no_log=False),

@ -77,3 +77,22 @@
that:
- "'RealName: ansibulluser' in user_test2.stdout_lines "
- "'PrimaryGroupID: 20' in user_test2.stdout_lines "
#https://github.com/ansible/ansible/issues/82490
- name: Create a new user with custom shell to test ~ expansion
user:
name: bob
shell: ~/custom_shell
register: user_create_result
- name: Create a new user with custom shell to test ~ expansion second time should show ok not changed
user:
name: bob
shell: ~/custom_shell
register: user_creation_result
- name: Assert that the user with a tilde in the shell path is created
assert:
that:
- user_creation_result is not changed
- user_create_result is changed
Loading…
Cancel
Save