ansible.builtin.dimensiondata_vlan (v2.9.27) — module

Manage a VLAN in a Cloud Control network domain.

| "added in version" 2.5 of ansible.builtin"

Authors: Adam Friedman (@tintoy)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Manage VLANs in Cloud Control network domains.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add or update VLAN
- dimensiondata_vlan:
    region: na
    location: NA5
    network_domain: test_network
    name: my_vlan1
    description: A test VLAN
    private_ipv4_base_address: 192.168.23.0
    private_ipv4_prefix_size: 24
    state: present
    wait: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Read / get VLAN details
- dimensiondata_vlan:
    region: na
    location: NA5
    network_domain: test_network
    name: my_vlan1
    state: readonly
    wait: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete a VLAN
- dimensiondata_vlan:
    region: na
    location: NA5
    network_domain: test_network
    name: my_vlan_1
    state: absent
    wait: yes

Inputs

    
name:
    description:
    - The name of the target VLAN.
    - Required if C(state) is C(present).

wait:
    default: false
    description:
    - Should we wait for the task to complete before moving onto the next.
    type: bool

state:
    choices:
    - present
    - absent
    - readonly
    default: present
    description:
    - The desired state for the target VLAN.
    - C(readonly) ensures that the state is only ever read, not modified (the module will
      fail if the resource does not exist).

region:
    default: na
    description:
    - The target region.
    - Regions are defined in Apache libcloud project [libcloud/common/dimensiondata.py]
    - They are also listed in U(https://libcloud.readthedocs.io/en/latest/compute/drivers/dimensiondata.html)
    - Note that the default value "na" stands for "North America".
    - The module prepends 'dd-' to the region choice.
    type: str

location:
    description:
    - The target datacenter.
    required: true
    type: str

mcp_user:
    description:
    - The username used to authenticate to the CloudControl API.
    - If not specified, will fall back to C(MCP_USER) from environment variable or C(~/.dimensiondata).
    type: str

wait_time:
    default: 600
    description:
    - The maximum amount of time (in seconds) to wait for the task to complete.
    - Only applicable if I(wait=true).
    type: int

description:
    description:
    - A description of the VLAN.

allow_expand:
    default: 'no'
    description:
    - Permit expansion of the target VLAN's network if the module parameters specify a
      larger network than the VLAN currently possesses.
    - If C(False), the module will fail under these conditions.
    - This is intended to prevent accidental expansion of a VLAN's network (since this
      operation is not reversible).
    type: bool

mcp_password:
    description:
    - The password used to authenticate to the CloudControl API.
    - If not specified, will fall back to C(MCP_PASSWORD) from environment variable or
      C(~/.dimensiondata).
    - Required if I(mcp_user) is specified.
    type: str

network_domain:
    description:
    - The Id or name of the target network domain.
    required: true

validate_certs:
    default: true
    description:
    - If C(false), SSL certificates will not be validated.
    - This should only be used on private instances of the CloudControl API that use self-signed
      certificates.
    type: bool

wait_poll_interval:
    default: 2
    description:
    - The amount of time (in seconds) to wait between checks for task completion.
    - Only applicable if I(wait=true).
    type: int

private_ipv4_prefix_size:
    description:
    - The size of the IPv4 address space, e.g 24.
    - Required, if C(private_ipv4_base_address) is specified.

private_ipv4_base_address:
    description:
    - The base address for the VLAN's IPv4 network (e.g. 192.168.1.0).

Outputs

vlan:
  contains:
    description:
      description: VLAN description.
      sample: My VLAN description
      type: str
    id:
      description: VLAN ID.
      sample: aaaaa000-a000-4050-a215-2808934ccccc
      type: str
    location:
      description: Datacenter location.
      sample: NA3
      type: str
    name:
      description: VLAN name.
      sample: My VLAN
      type: str
    private_ipv4_base_address:
      description: The base address for the VLAN's private IPV4 network.
      sample: 192.168.23.0
      type: str
    private_ipv4_gateway_address:
      description: The gateway address for the VLAN's private IPV4 network.
      sample: 192.168.23.1
      type: str
    private_ipv4_prefix_size:
      description: The prefix size for the VLAN's private IPV4 network.
      sample: 24
      type: int
    private_ipv6_base_address:
      description: The base address for the VLAN's IPV6 network.
      sample: 2402:9900:111:1195:0:0:0:0
      type: str
    private_ipv6_gateway_address:
      description: The gateway address for the VLAN's IPV6 network.
      sample: 2402:9900:111:1195:0:0:0:1
      type: str
    private_ipv6_prefix_size:
      description: The prefix size for the VLAN's IPV6 network.
      sample: 64
      type: int
    status:
      description: VLAN status.
      sample: NORMAL
      type: str
  description: Dictionary describing the VLAN.
  returned: On success when I(state) is 'present'
  type: complex