LAN

lan

This module allows you to create or remove a LAN.

Example Syntax


name: Create LAN
ionoscloudsdk.ionoscloud.lan:
  datacenter: 'AnsibleAutoTestCompute'
  name: 'AnsibleAutoTestCompute'
  public: false
register: ionos_cloud_lan


name: Update LAN
ionoscloudsdk.ionoscloud.lan:
  datacenter: 'AnsibleAutoTestCompute'
  lan: 'AnsibleAutoTestCompute'
  pcc: ''
  state: update


name: Remove LAN
ionoscloudsdk.ionoscloud.lan:
  datacenter: 'AnsibleAutoTestCompute'
  lan: 'AnsibleAutoTestCompute'
  state: absent
  wait: true

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "lan": {
        "entities": null,
        "href": "https://api.ionos.com/cloudapi/v6/datacenters/f6e15460-e5eb-451a-9da7-08c9da65a179/lans/1",
        "id": "1",
        "metadata": {
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "created_date": "2023-05-29T09:26:00+00:00",
            "etag": "5200f351d90b89ae0282b81a8da77efe",
            "last_modified_by": "<USER_EMAIL>",
            "last_modified_by_user_id": "<USER_ID>",
            "last_modified_date": "2023-05-29T09:26:00+00:00",
            "state": "BUSY"
        },
        "properties": {
            "ip_failover": null,
            "name": "AnsibleAutoTestCompute",
            "pcc": null,
            "public": true
        },
        "type": "lan"
    }
}

For more examples please check out the tests here.

state: present

  
name: Create LAN
ionoscloudsdk.ionoscloud.lan:
  datacenter: 'AnsibleAutoTestCompute'
  name: 'AnsibleAutoTestCompute'
  public: false
register: ionos_cloud_lan

Available parameters for state present:

Name
Required
Description

datacenter str

True

The datacenter name or UUID in which to operate.

name str

True

The name of the resource.

pcc str

False

The unique identifier of the Cross Connect the LAN is connected to, if any. It needs to be ensured that IP addresses of the NICs of all LANs connected to a given Cross Connect is not duplicated and belongs to the same subnet range.

public bool

False

Indicates if the LAN is connected to the internet or not. Default: False

ipv6_cidr str

False

For a GET request, this value is either 'null' or contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled. For POST/PUT/PATCH requests, 'AUTO' will result in enabling this LAN for IPv6 and automatically assign a /64 IPv6 CIDR block to this LAN and /80 IPv6 CIDR blocks to the NICs and one /128 IPv6 address to each connected NIC. If you choose the IPv6 CIDR block for the LAN on your own, then you must provide a /64 block, which is inside the IPv6 CIDR block of the virtual datacenter and unique inside all LANs from this virtual datacenter. If you enable IPv6 on a LAN with NICs, those NICs will get a /80 IPv6 CIDR block and one IPv6 address assigned to each automatically, unless you specify them explicitly on the LAN and on the NICs. A virtual data center is limited to a maximum of 256 IPv6-enabled LANs.

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: Remove LAN
ionoscloudsdk.ionoscloud.lan:
  datacenter: 'AnsibleAutoTestCompute'
  lan: 'AnsibleAutoTestCompute'
  state: absent
  wait: true

Available parameters for state absent:

Name
Required
Description

datacenter str

True

The datacenter name or UUID in which to operate.

lan str

True

The LAN name or UUID.

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 LAN
ionoscloudsdk.ionoscloud.lan:
  datacenter: 'AnsibleAutoTestCompute'
  lan: 'AnsibleAutoTestCompute'
  pcc: ''
  state: update

Available parameters for state update:

Name
Required
Description

datacenter str

True

The datacenter name or UUID in which to operate.

lan str

True

The LAN name or UUID.

name str

False

The name of the resource.

pcc str

False

The unique identifier of the Cross Connect the LAN is connected to, if any. It needs to be ensured that IP addresses of the NICs of all LANs connected to a given Cross Connect is not duplicated and belongs to the same subnet range.

ip_failover list

False

IP failover configurations for lan

public bool

False

Indicates if the LAN is connected to the internet or not. Default: False

ipv6_cidr str

False

For a GET request, this value is either 'null' or contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled. For POST/PUT/PATCH requests, 'AUTO' will result in enabling this LAN for IPv6 and automatically assign a /64 IPv6 CIDR block to this LAN and /80 IPv6 CIDR blocks to the NICs and one /128 IPv6 address to each connected NIC. If you choose the IPv6 CIDR block for the LAN on your own, then you must provide a /64 block, which is inside the IPv6 CIDR block of the virtual datacenter and unique inside all LANs from this virtual datacenter. If you enable IPv6 on a LAN with NICs, those NICs will get a /80 IPv6 CIDR block and one IPv6 address assigned to each automatically, unless you specify them explicitly on the LAN and on the NICs. A virtual data center is limited to a maximum of 256 IPv6-enabled LANs.

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