herve4m.quay.quay_user (1.2.0) — module

Manage Quay Container Registry users

| "added in version" 0.0.1 of herve4m.quay"

Authors: Herve Quatremain (@herve4m)

Install collection

Install with ansible-galaxy collection install herve4m.quay:==1.2.0


Add to requirements.yml

  collections:
    - name: herve4m.quay
      version: 1.2.0

Description

Create, delete, and update user accounts in Quay Container Registry.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the user exists
  herve4m.quay.quay_user:
    username: lvasquez
    email: lvasquez@example.com
    password: vs9mrD55NP
    state: present
    quay_host: https://quay.example.com
    quay_token: vgfH9zH5q6eV16Con7SvDQYSr0KPYQimMHVehZv7
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the user is removed
  herve4m.quay.quay_user:
    username: dwilde
    state: absent
    quay_host: https://quay.example.com
    quay_token: vgfH9zH5q6eV16Con7SvDQYSr0KPYQimMHVehZv7
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the user is a superuser
  herve4m.quay.quay_user:
    username: jziglar
    email: jziglar@example.com
    state: present
    # Only effective after a restart of the Quay Container Registry service.
    superuser: true
    quay_host: https://quay.example.com
    quay_token: vgfH9zH5q6eV16Con7SvDQYSr0KPYQimMHVehZv7
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the user account is disabled
  herve4m.quay.quay_user:
    username: chorwitz
    email: chorwitz@example.com
    state: present
    enabled: false
    quay_host: https://quay.example.com
    quay_token: vgfH9zH5q6eV16Con7SvDQYSr0KPYQimMHVehZv7

Inputs

    
email:
    description:
    - User's email address.
    - If your Quay administrator has enabled the mailing capability of your Quay installation
      (C(FEATURE_MAILING) to C(true) in C(config.yaml)), then this I(email) parameter
      is mandatory.
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - If C(absent), then the module deletes the user.
    - You cannot delete superuser accounts.
    - The module does not fail if the user does not exist, because the state is already
      as expected.
    - If C(present), then the module creates the user if it does not already exist.
    - If the user account already exists, then the module updates its state.
    - You cannot update superuser accounts.
    type: str

enabled:
    description:
    - Enable (C(true)) or disable (C(false)) the user account.
    - When their account is disabled, the user cannot log in to the web UI and cannot
      push or pull container images.
    type: bool

password:
    description:
    - User's password as a clear string.
    - The password must be at least eight characters long and must not contain white spaces.
    type: str

username:
    description:
    - Name of the user account to create, remove, or modify.
    required: true
    type: str

quay_host:
    default: http://127.0.0.1
    description:
    - URL for accessing the API. U(https://quay.example.com:8443) for example.
    - If you do not set the parameter, then the module uses the C(QUAY_HOST) environment
      variable.
    - If you do no set the environment variable either, then the module uses the U(http://127.0.0.1)
      URL.
    type: str

superuser:
    aliases:
    - is_superuser
    description:
    - Grant superuser permissions to the user.
    - Granting superuser privileges to a user is not immediate and usually requires a
      restart of the Quay Container Registry service.
    - You cannot revoke superuser permissions.
    type: bool

quay_token:
    description:
    - OAuth access token for authenticating against the API.
    - If you do not set the parameter, then the module tries the C(QUAY_TOKEN) environment
      variable.
    - Mutually exclusive with I(quay_username) and I(quay_password).
    type: str

quay_password:
    description:
    - The password to use for authenticating against the API.
    - If you do not set the parameter, then the module tries the C(QUAY_PASSWORD) environment
      variable.
    - If you set I(quay_password), then you also need to set I(quay_username).
    - Mutually exclusive with I(quay_token).
    type: str

quay_username:
    description:
    - The username to use for authenticating against the API.
    - If you do not set the parameter, then the module tries the C(QUAY_USERNAME) environment
      variable.
    - If you set I(quay_username), then you also need to set I(quay_password).
    - Mutually exclusive with I(quay_token).
    type: str

validate_certs:
    aliases:
    - verify_ssl
    default: true
    description:
    - Whether to allow insecure connections to the API.
    - If C(no), then the module does not validate SSL certificates.
    - If you do not set the parameter, then the module tries the C(QUAY_VERIFY_SSL) environment
      variable (C(yes), C(1), and C(True) mean yes, and C(no), C(0), C(False), and no
      value mean no).
    type: bool