ansible.builtin.gitlab_user (v2.5.10) — module

Creates/updates/deletes Gitlab Users

| "added in version" 2.1 of ansible.builtin"

Authors: Werner Dijkerman (@dj-wasabi)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.10

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 changes are made to user, the user will be updated.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Gitlab User
  gitlab_user:
    server_url: http://gitlab.example.com
    validate_certs: False
    login_token: WnUzDsxjy8230-Dy_k
    username: myusername
    state: absent
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Gitlab User
  gitlab_user:
    server_url: https://gitlab.dj-wasabi.local
    validate_certs: True
    login_user: dj-wasabi
    login_password: MySecretPassword
    name: My Name
    username: myusername
    password: mysecretpassword
    email: me@example.com
    sshkey_name: MySSH
    sshkey_file: ssh-rsa AAAAB3NzaC1yc...
    state: present
  delegate_to: localhost

Inputs

    
name:
    description:
    - Name of the user you want to create
    required: true

email:
    description:
    - The email that belongs to the user.
    required: true

group:
    default: null
    description:
    - Add user as an member to this group.
    required: false

state:
    choices:
    - present
    - absent
    default: present
    description:
    - create or delete group.
    - Possible values are present and absent.
    required: false

confirm:
    default: true
    description:
    - Require confirmation.
    required: false
    version_added: '2.4'
    version_added_collection: ansible.builtin

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

username:
    description:
    - The username of the user.
    required: true

login_user:
    default: null
    description:
    - Gitlab user name.
    required: false

server_url:
    description:
    - Url of Gitlab server, with protocol (http or https).
    required: true

login_token:
    default: null
    description:
    - Gitlab token for logging in.
    required: false

sshkey_file:
    default: null
    description:
    - The ssh key itself.
    required: false

sshkey_name:
    default: null
    description:
    - The name of the sshkey
    required: false

access_level:
    default: null
    description:
    - The access level to the group. One of the following can be used.
    - guest
    - reporter
    - developer
    - master
    - owner
    required: false

login_password:
    default: null
    description:
    - Gitlab password for login_user
    required: false

validate_certs:
    aliases:
    - verify_ssl
    default: true
    description:
    - When using https if SSL certificate needs to be verified.
    required: false