herve4m.quay.quay_application (1.2.0) — module

Manage Quay Container Registry applications

| "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 applications in Quay organizations.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the application extapp exists
  herve4m.quay.quay_application:
    organization: production
    name: extapp
    description: External application
    application_uri: http://applicationuri.example.com
    redirect_uri: http://redirecturi.example.com
    avatar_email: avatarextapp@example.com
    state: present
    quay_host: https://quay.example.com
    quay_token: vgfH9zH5q6eV16Con7SvDQYSr0KPYQimMHVehZv7
  register: app_details
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: "Client secret: {{ app_details['client_secret'] }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the application is renamed
  herve4m.quay.quay_application:
    organization: production
    name: extapp
    new_name: apiaccess
    description: Application dedicated to API access
    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 application is removed
  herve4m.quay.quay_application:
    organization: production
    name: apiaccess
    state: absent
    quay_host: https://quay.example.com
    quay_token: vgfH9zH5q6eV16Con7SvDQYSr0KPYQimMHVehZv7

Inputs

    
name:
    description:
    - Name of the application to create, update, or delete. Application names must be
      at least two characters long.
    required: true
    type: str

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

new_name:
    description:
    - New name for the application.
    - Setting this option changes the name of the application which current name is provided
      in I(name).
    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

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

description:
    description:
    - Description for the application.
    type: str

avatar_email:
    description:
    - Email address that represents the avatar for the application.
    type: str

organization:
    description:
    - Name of the organization in which to manage the application.
    required: true
    type: str

redirect_uri:
    description:
    - Prefix of the application's OAuth redirection/callback URLs.
    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

application_uri:
    description:
    - URL to the application home page.
    type: str

Outputs

client_id:
  description: ID if the client associated with the application object.
  returned: always
  sample: SUJVKUJN5WIP07CAIXAF
  type: str
client_secret:
  description: Secret for the client associated with the application object.
  returned: always
  sample: JBVXLG8XS7UCV1NFKDYPSNGJ4BUESU03GI5OXS2X
  type: str
name:
  description: Application name.
  returned: always
  sample: apiaccess
  type: str