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