# Secondary Zone

## dns\_secondary\_zone

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

### Example Syntax

```yaml

name: Create Secondary Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  name: 'test.example.test.ansible.com'
  description: 'test_description'
  primary_ips: ''
register: zone_response


name: Update Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  description: 'zone_description_updated'
  primary_ips: ''
  allow_replace: false
  state: update
register: updated_zone_response


name: Transfer Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: false
  state: transfer


name: Delete Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: true
  state: absent

```

&#x20; &#x20;

### Returned object

```json
{
    "changed": false,
    "failed": false,
    "action": "create",
    "secondary_zone": {
        "id": "bb1a4664-0f79-57e2-85ff-36c22b164884",
        "type": "secondaryzone",
        "href": "/secondaryzones/bb1a4664-0f79-57e2-85ff-36c22b164884",
        "metadata": {
            "last_modified_date": "2023-10-25T14:26:17+00:00",
            "created_date": "2023-10-25T14:26:17+00:00",
            "state": "AVAILABLE",
            "nameservers": [
                "<NAMESERVER1>",
                "<NAMESERVER2>",
                "<NAMESERVER3>",
                "<NAMESERVER4>"
            ]
        },
        "properties": {
            "zone_name": "<ZONE_NAME>",
            "description": "test_description",
            "primary_ips": [
                "<IP1>",
                "<IP2>"
            ]
        }
    }
}

```

#### For more examples please check out the tests [here](https://github.com/ionos-cloud/module-ansible/tree/master/tests/dns).

&#x20;

&#x20;

## state: **present**

```yaml
  
name: Create Secondary Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  name: 'test.example.test.ansible.com'
  description: 'test_description'
  primary_ips: ''
register: zone_response

```

#### Available parameters for state **present**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>name<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The zone name</td></tr><tr><td>description<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The hosted zone is used for...</td></tr><tr><td>primary_ips<br><mark style="color:blue;">list</mark></td><td align="center">False</td><td>Indicates IP addresses of primary nameservers for a secondary zone. Accepts IPv4 and IPv6 addresses</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **absent**

```yaml
  
name: Delete Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: true
  state: absent

```

#### Available parameters for state **absent**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>secondary_zone<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or name of an existing Secondary Zone.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **update**

```yaml
  
name: Update Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  description: 'zone_description_updated'
  primary_ips: ''
  allow_replace: false
  state: update
register: updated_zone_response

```

#### Available parameters for state **update**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>name<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The zone name</td></tr><tr><td>description<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The hosted zone is used for...</td></tr><tr><td>primary_ips<br><mark style="color:blue;">list</mark></td><td align="center">False</td><td>Indicates IP addresses of primary nameservers for a secondary zone. Accepts IPv4 and IPv6 addresses</td></tr><tr><td>secondary_zone<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or name of an existing Secondary Zone.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;

## state: **transfer**

```yaml
  
name: Transfer Zone
ionoscloudsdk.ionoscloud.dns_secondary_zone:
  secondary_zone: ''
  wait: false
  state: transfer

```

#### Available parameters for state **transfer**:

&#x20;

<table data-full-width="true"><thead><tr><th width="70">Name</th><th width="40" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td>secondary_zone<br><mark style="color:blue;">str</mark></td><td align="center">True</td><td>The ID or name of an existing Secondary Zone.</td></tr><tr><td>api_url<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API base URL.</td></tr><tr><td>certificate_fingerprint<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos API certificate fingerprint.</td></tr><tr><td>username<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos username. Overrides the IONOS_USERNAME environment variable.</td></tr><tr><td>password<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos password. Overrides the IONOS_PASSWORD environment variable.</td></tr><tr><td>token<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>The Ionos token. Overrides the IONOS_TOKEN environment variable.</td></tr><tr><td>wait<br><mark style="color:blue;">bool</mark></td><td align="center">False</td><td>Wait for the resource to be created before returning.<br>Default: True<br>Options: [True, False]</td></tr><tr><td>wait_timeout<br><mark style="color:blue;">int</mark></td><td align="center">False</td><td>How long before wait gives up, in seconds.<br>Default: 600</td></tr><tr><td>state<br><mark style="color:blue;">str</mark></td><td align="center">False</td><td>Indicate desired state of the resource.<br>Default: present<br>Options: ['present', 'absent', 'update', 'transfer']</td></tr></tbody></table>

&#x20;

&#x20;
