nttmcp.mcp.nat (1.0.9) — module

Add and Remove NAT entries

| "added in version" 2.10.0 of nttmcp.mcp"

Authors: Ken Sinfield (@kensinfield)

preview | supported by NTT Ltd.

Install collection

Install with ansible-galaxy collection install nttmcp.mcp:==1.0.9


Add to requirements.yml

  collections:
    - name: nttmcp.mcp
      version: 1.0.9

Description

Add and Remove NAT entries


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- hosts: 127.0.0.1
  connection: local
  collections:
    - nttmcp.mcp
  tasks:

  - name: Create the NAT rule for an internal IP using auto allocated public IPv4 address
    nat:
      region: na
      datacenter: NA12
      network_domain: myCND
      internal_ip: 10.1.77.6
      state: present

  - name: Create a NAT rule for the internal IP with a specific external_ip
    nat:
      region: na
      datacenter: NA12
      network_domain: myCND
      internal_ip: 10.1.77.6
      external_ip: x.x.x.x
      state: present

  - name: Update a NAT rule
    nat:
      region: na
      datacenter: NA12
      network_domain: myCND
      internal_ip: 10.1.77.6
      external_ip: x.x.x.x
      state: present

  - name: Delete a NAT rule by internal_ip (can also use external_ip or id)
    nat:
      region: na
      datacenter: NA12
      network_domain: myCND
      internal_ip: 10.1.77.6
      state: absent

Inputs

    
id:
    description:
    - The UUID of the NAT rule
    required: false
    type: str

auth:
    description:
    - Optional dictionary containing the authentication and API information for Cloud
      Control
    required: false
    suboptions:
      api:
        description:
        - The Cloud Control API endpoint e.g. api-na.mcp-services.net
        required: false
        type: str
      api_version:
        description:
        - The Cloud Control API version e.g. 2.11
        required: false
        type: str
      password:
        description:
        - The Cloud Control API user password
        required: false
        type: str
      username:
        description:
        - The Cloud Control API username
        required: false
        type: str
    type: dict

state:
    choices:
    - present
    - absent
    default: present
    description:
    - The action to be performed
    required: false
    type: str

region:
    default: na
    description:
    - The geographical region
    required: false
    type: str

datacenter:
    description:
    - The datacenter name
    required: true
    type: str

external_ip:
    description:
    - The external IPv4 address of the NAT - This does not have to be an MCP allocated
      public IPv4 address
    - Using 192.168.0.10 is perfectly valid as an external_ip address
    - The external_ip address value does *not* need to be in the range of any subnets
      on within your Cloud
    - Network Domain
    - Not required if the user just wants the next available public IPv4 address.
    - Only use if the external_ip must be set to a specific IPv4 address
    required: false
    type: str

internal_ip:
    description:
    - The internal IP address of the NAT
    required: false
    type: str

network_domain:
    description:
    - The name of a Cloud Network Domain
    required: true
    type: str

Outputs

data:
  contains:
    count:
      description: The number of objects returned
      returned: success
      sample: 1
      type: int
    nat:
      contains:
        createTime:
          description: The creation date of the image
          returned: when state == present
          sample: '2019-01-14T11:12:31.000Z'
          type: str
        datacenterId:
          description: Datacenter id/location
          returned: when state == present
          sample: NA3
          type: str
        externalIp:
          description: The public IPv4 address of the NAT
          returned: when state == present
          sample: x.x.x.x
          type: str
        externalIpAddressability:
          description: Internal Use
          returned: when state == present
          sample: PUBLIC_IP_BLOCK
          type: str
        id:
          description: The UUID of the NAT entry
          returned: when state == present
          sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
          type: str
        internalIp:
          description: The internal IPv4 address of a host
          returned: when state == present
          sample: 10.0.0.10
          type: str
        networkDomainId:
          description: Network Domain ID
          returned: when state == present
          sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
          type: str
        state:
          description: Status of the VLAN
          returned: when state == present
          sample: NORMAL
          type: str
      description: a single or list of IP address objects or strs
      returned: success
      type: complex
  description: Server objects
  returned: success
  type: complex