mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
univention udm_user: add parameter to control password update (#20699)
* univention udm_user: added support to set the password always * module udm_user: added version 2.3 to update_password
This commit is contained in:
parent
4269b12c9d
commit
4f117df6ec
1 changed files with 11 additions and 1 deletions
|
@ -304,6 +304,13 @@ options:
|
||||||
description:
|
description:
|
||||||
- "Define the whole position of users object inside the LDAP tree,
|
- "Define the whole position of users object inside the LDAP tree,
|
||||||
e.g. C(cn=employee,cn=users,ou=school,dc=example,dc=com)."
|
e.g. C(cn=employee,cn=users,ou=school,dc=example,dc=com)."
|
||||||
|
update_password:
|
||||||
|
required: false
|
||||||
|
default: always
|
||||||
|
description:
|
||||||
|
- "C(always) will update passwords if they differ.
|
||||||
|
C(on_create) will only set the password for newly created users."
|
||||||
|
version_added: "2.3"
|
||||||
ou:
|
ou:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
@ -466,6 +473,9 @@ def main():
|
||||||
type='str'),
|
type='str'),
|
||||||
position = dict(default='',
|
position = dict(default='',
|
||||||
type='str'),
|
type='str'),
|
||||||
|
update_password = dict(default='always',
|
||||||
|
choices=['always', 'on_create'],
|
||||||
|
type='str'),
|
||||||
ou = dict(default='',
|
ou = dict(default='',
|
||||||
type='str'),
|
type='str'),
|
||||||
subpath = dict(default='cn=users',
|
subpath = dict(default='cn=users',
|
||||||
|
@ -530,7 +540,7 @@ def main():
|
||||||
password = module.params['password']
|
password = module.params['password']
|
||||||
if obj['password'] is None:
|
if obj['password'] is None:
|
||||||
obj['password'] = password
|
obj['password'] = password
|
||||||
else:
|
if module.params['update_password'] == 'always':
|
||||||
old_password = obj['password'].split('}', 2)[1]
|
old_password = obj['password'].split('}', 2)[1]
|
||||||
if crypt.crypt(password, old_password) != old_password:
|
if crypt.crypt(password, old_password) != old_password:
|
||||||
obj['overridePWHistory'] = module.params['overridePWHistory']
|
obj['overridePWHistory'] = module.params['overridePWHistory']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue