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