Registry Token

registry_token

This is a module that supports creating, updating or destroying Registry Tokens

Example Syntax


name: Create Registry Token
ionoscloudsdk.ionoscloud.registry_token:
  registry: ''
  name: testRegistryToken
  scopes:
  - actions:
    - pull
    - push
    name: nume
    type: repository
  status: enabled
register: registry_token_response


name: Update Registry Token
ionoscloudsdk.ionoscloud.registry_token:
  registry: ''
  registry_token: ''
  scopes:
  - actions:
    - pull
    - push
    - delete
    name: nume
    type: repo1
  status: disabled
  allow_replace: false
  state: update
register: registry_token_response


name: Delete Registry Token
ionoscloudsdk.ionoscloud.registry_token:
  registry: ''
  registry_token: ''
  state: absent
register: registry_token_response

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "registry_token": {
        "href": "",
        "id": "1e9f63b6-ff23-41ab-8f7e-57dd1008d6b5",
        "metadata": {
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "created_date": "2023-05-29T13:51:29+00:00",
            "last_modified_by": null,
            "last_modified_by_user_id": null,
            "last_modified_date": null,
            "state": "enabled"
        },
        "properties": {
            "credentials": {
                "password": "<PASSWORD>",
                "username": "testRegistryToken"
            },
            "expiry_date": null,
            "name": "testRegistryToken",
            "scopes": [
                {
                    "actions": [
                        "pull",
                        "push"
                    ],
                    "name": "nume",
                    "type": "repo"
                }
            ],
            "status": "enabled"
        },
        "type": "token"
    }
}

For more examples please check out the tests here.

NOTE: If you are using a versions 7.0.0 and up: modules can replace resources if certain set parameters differ from the results found in the API!

Parameters that can trigger a resource replacement:

  • name

state: present

  
name: Create Registry Token
ionoscloudsdk.ionoscloud.registry_token:
  registry: ''
  name: testRegistryToken
  scopes:
  - actions:
    - pull
    - push
    name: nume
    type: repository
  status: enabled
register: registry_token_response

Available parameters for state present:

NameRequiredDescription

scopes list

False

List of scopes for the token

expiry_date str

False

The expiry date for the token in iso format

status str

False

The status of the token

name str

True

The name of your token.

registry str

True

The ID or name of an existing Registry.

allow_replace bool

False

Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: absent

  
name: Delete Registry Token
ionoscloudsdk.ionoscloud.registry_token:
  registry: ''
  registry_token: ''
  state: absent
register: registry_token_response

Available parameters for state absent:

NameRequiredDescription

registry_token str

True

The ID or name of an existing token.

registry str

True

The ID or name of an existing Registry.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: update

  
name: Update Registry Token
ionoscloudsdk.ionoscloud.registry_token:
  registry: ''
  registry_token: ''
  scopes:
  - actions:
    - pull
    - push
    - delete
    name: nume
    type: repo1
  status: disabled
  allow_replace: false
  state: update
register: registry_token_response

Available parameters for state update:

NameRequiredDescription

scopes list

False

List of scopes for the token

expiry_date str

False

The expiry date for the token in iso format

status str

False

The status of the token

name str

False

The name of your token.

registry_token str

True

The ID or name of an existing token.

registry str

True

The ID or name of an existing Registry.

allow_replace bool

False

Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

Last updated