Zone

dns_zone

This is a module that supports creating, updating or destroying DNS Zones

Example Syntax


name: Create Zone
ionoscloudsdk.ionoscloud.dns_zone:
  name: 'test.example.test.ansible.com'
  description: 'test_description'
  enabled: 'False'
register: zone_response


name: Update Zone
ionoscloudsdk.ionoscloud.dns_zone:
  zone: ''
  description: 'zone_description_updated'
  enabled: 'True'
  allow_replace: false
  state: update
register: updated_zone_response


name: Delete Zone
ionoscloudsdk.ionoscloud.dns_zone:
  zone: ''
  wait: true
  state: absent

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "zone": {
        "id": "36d63502-7110-57f3-8794-a24fe8959d18",
        "type": "zone",
        "href": "/zones/36d63502-7110-57f3-8794-a24fe8959d18",
        "metadata": {
            "last_modified_date": "2023-10-05T14:38:51+00:00",
            "created_date": "2023-10-05T14:38:51+00:00",
            "state": "AVAILABLE",
            "nameservers": [
                "<NAMESERVER1>",
                "<NAMESERVER2>",
                "<NAMESERVER3>",
                "<NAMESERVER4>"
            ]
        },
        "properties": {
            "zone_name": "<ZONE_NAME>",
            "description": "test_description",
            "enabled": true
        }
    }
}

For more examples please check out the tests here.

state: present

  
name: Create Zone
ionoscloudsdk.ionoscloud.dns_zone:
  name: 'test.example.test.ansible.com'
  description: 'test_description'
  enabled: 'False'
register: zone_response

Available parameters for state present:

NameRequiredDescription

enabled bool

False

Users can activate and deactivate zones.

description str

False

The hosted zone is used for...

name str

True

The zone name

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 Zone
ionoscloudsdk.ionoscloud.dns_zone:
  zone: ''
  wait: true
  state: absent

Available parameters for state absent:

NameRequiredDescription

zone str

True

The ID or name of an existing Zone.

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 Zone
ionoscloudsdk.ionoscloud.dns_zone:
  zone: ''
  description: 'zone_description_updated'
  enabled: 'True'
  allow_replace: false
  state: update
register: updated_zone_response

Available parameters for state update:

NameRequiredDescription

enabled bool

False

Users can activate and deactivate zones.

description str

False

The hosted zone is used for...

name str

False

The zone name

zone str

True

The ID or name of an existing Zone.

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