From dd6532b29ad0094eb9ad42d229a6f583bae3ee34 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Fri, 1 Dec 2017 12:38:44 +0530 Subject: [PATCH] Add limit for new password in gitlab_user (#33374) Fixes: #29399 Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/source_control/gitlab_user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/source_control/gitlab_user.py b/lib/ansible/modules/source_control/gitlab_user.py index 41b54c7832..aac1d5586d 100644 --- a/lib/ansible/modules/source_control/gitlab_user.py +++ b/lib/ansible/modules/source_control/gitlab_user.py @@ -62,6 +62,7 @@ options: password: description: - The password of the user. + - GitLab server enforces minimum password length to 8, set this value with 8 or more characters. required: true email: description: @@ -302,6 +303,9 @@ def main(): state = module.params['state'] confirm = module.params['confirm'] + if len(user_password) < 8: + module.fail_json(msg="New user's 'password' should contain more than 8 characters.") + # We need both login_user and login_password or login_token, otherwise we fail. if login_user is not None and login_password is not None: use_credentials = True