Skip to content

Commit

Permalink
univention udm_user: override password history.
Browse files Browse the repository at this point in the history
  • Loading branch information
keachi authored and mattclay committed Dec 8, 2016
1 parent 10a2eb9 commit e4dd122
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/ansible/modules/extras/univention/udm_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@
default: None
description:
- Organisation
overridePWHistory:
required: false
default: False
description:
- Override password history
overridePWLength:
required: false
default: False
description:
- Override password check
pager_telephonenumber:
required: false
default: []
Expand Down Expand Up @@ -390,6 +400,10 @@ def main():
aliases=['mobileTelephoneNumber']),
organisation = dict(default=None,
type='str'),
overridePWHistory = dict(default=False,
type='bool'),
overridePWLength = dict(default=False,
type='bool'),
pager_telephonenumber = dict(default=[],
type='list',
aliases=['pagerTelephonenumber']),
Expand Down Expand Up @@ -496,6 +510,7 @@ def main():
for k in obj.keys():
if (k != 'password' and
k != 'groups' and
k != 'overridePWHistory' and
k in module.params and
module.params[k] is not None):
obj[k] = module.params[k]
Expand All @@ -507,6 +522,8 @@ def main():
else:
old_password = obj['password'].split('}', 2)[1]
if crypt.crypt(password, old_password) != old_password:
obj['overridePWHistory'] = module.params['overridePWHistory']
obj['overridePWLength'] = module.params['overridePWLength']
obj['password'] = password

diff = obj.diff()
Expand Down

0 comments on commit e4dd122

Please sign in to comment.