From e4dd122ab76d1b7c9b41cc9b8213db9934ca054c Mon Sep 17 00:00:00 2001
From: Tobias Rueetschi
Date: Tue, 30 Aug 2016 21:47:04 +0200
Subject: [PATCH] univention udm_user: override password history.
---
.../modules/extras/univention/udm_user.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/lib/ansible/modules/extras/univention/udm_user.py b/lib/ansible/modules/extras/univention/udm_user.py
index 11213e465a..c3406b2729 100644
--- a/lib/ansible/modules/extras/univention/udm_user.py
+++ b/lib/ansible/modules/extras/univention/udm_user.py
@@ -184,6 +184,16 @@ options:
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: []
@@ -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']),
@@ -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]
@@ -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()