community.general.gitlab_user – Creates/updates/deletes/blocks/unblocks GitLab Users¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.gitlab_user
.
Synopsis¶
When the user does not exist in GitLab, it will be created.
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.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
python-gitlab python module
administrator rights on the GitLab server
Parameters¶
Notes¶
Note
From community.general 0.2.0 and onwards, name, email and password are optional while deleting the user.
Examples¶
- name: "Delete GitLab User"
community.general.gitlab_user:
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
validate_certs: False
username: myusername
state: absent
- name: "Create GitLab User"
community.general.gitlab_user:
api_url: https://gitlab.example.com/
validate_certs: True
api_username: dj-wasabi
api_password: "MySecretPassword"
name: My Name
username: myusername
password: mysecretpassword
email: [email protected]
sshkey_name: MySSH
sshkey_file: ssh-rsa AAAAB3NzaC1yc...
state: present
group: super_group/mon_group
access_level: owner
- name: "Block GitLab User"
community.general.gitlab_user:
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
validate_certs: False
username: myusername
state: blocked
- name: "Unblock GitLab User"
community.general.gitlab_user:
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
validate_certs: False
username: myusername
state: unblocked
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Werner Dijkerman (@dj-wasabi)
Guillaume Martinez (@Lunik)