herve4m.quay.quay_first_user (1.2.0) — module

Create the first user account

| "added in version" 0.0.7 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 the first user just after installing Quay Container Registry.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the initial user exists
  herve4m.quay.quay_first_user:
    username: admin
    email: admin@example.com
    password: S6tGwo13
    create_token: true
    quay_host: https://quay.example.com
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: "Access token: {{ result['access_token'] }}"

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

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

username:
    description:
    - Name of the user account to create.
    - You probably want that user account to have superuser permissions so that you can
      use the returned token to create additional objects. To do so, add the account name
      to the C(SUPER_USERS) section in the C(config.yaml) file before using the M(herve4m.quay.quay_first_user)
      module.
    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

create_token:
    default: false
    description:
    - If C(yes), then an OAuth access token is created and returned. You can use that
      returned token with the other Quay modules, by setting it in the I(quay_token) parameter.
      The token is valid for 2 hours 30 minutes.
    - If C(no), then no access token is created.
    type: bool

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

Outputs

access_token:
  description:
  - The access token that you can use for subsequent module calls.
  - The token is valid for 2 hours 30 minutes.
  returned: only when you set the I(create_token) parameter to C(yes)
  sample: W2YX0V838JZ5FHHUH82Q25FZZMRX8YTB1MTN56P3
  type: str
email:
  description: User's email address.
  returned: always
  sample: admin@example.com
  type: str
encrypted_password:
  description: Encrypted user's password.
  returned: always
  sample: /pbR5LPYx4Y3w/SSf2dAwNxCCNgwmmZk+x04TKn6xEKL2At5wblOy7wA1tNZEhRc
  type: str
username:
  description: Name of the created user account.
  returned: always
  sample: admin
  type: str