1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes for comments from PR #188 (#191)

This commit is contained in:
Sven Meeus 2020-04-16 14:48:33 +02:00 committed by GitHub
parent 15e961c2ef
commit 22787e03d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,8 +18,8 @@ module: gitlab_user
short_description: Creates/updates/deletes/blocks/unblocks GitLab Users
description:
- When the user does not exist in GitLab, it will be created.
- When the user does exists and state=absent, the user will be deleted.
- When the user does exists and state=blocked, the user will be blocked.
- When the user exists and state=absent, the user will be deleted.
- When the user exists and state=blocked, the user will be blocked.
- When changes are made to user, the user will be updated.
notes:
- From Ansible 2.10 and onwards, name, email and password are optional while deleting the user.
@ -86,8 +86,7 @@ options:
choices: ["guest", "reporter", "developer", "master", "maintainer", "owner"]
state:
description:
- create, delete or block a user.
- Possible values are present, absent, blocked, and unblocked.
- Create, delete or block a user.
default: present
type: str
choices: ["present", "absent", "blocked", "unblocked"]
@ -116,7 +115,6 @@ EXAMPLES = '''
validate_certs: False
username: myusername
state: absent
delegate_to: localhost
- name: "Create GitLab User"
gitlab_user:
@ -133,7 +131,6 @@ EXAMPLES = '''
state: present
group: super_group/mon_group
access_level: owner
delegate_to: localhost
- name: "Block GitLab User"
gitlab_user:
@ -142,7 +139,6 @@ EXAMPLES = '''
validate_certs: False
username: myusername
state: blocked
delegate_to: localhost
- name: "Unblock GitLab User"
gitlab_user:
@ -151,7 +147,6 @@ EXAMPLES = '''
validate_certs: False
username: myusername
state: unblocked
delegate_to: localhost
'''
RETURN = '''
@ -490,7 +485,10 @@ def main():
gitlab_user = GitLabUser(module, gitlab_instance)
user_exists = gitlab_user.existsUser(user_username)
if user_exists:
user_is_active = gitlab_user.isActive(user_username)
else:
user_is_active = False
if state == 'absent':
if user_exists: