community.general.hwc_vpc_port (8.5.0) — module

Creates a resource of Vpc/Port in Huawei Cloud

| "added in version" 0.2.0 of community.general"

Authors: Huawei Inc. (@huaweicloud)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

vpc port management.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a port
- name: Create vpc
  hwc_network_vpc:
    cidr: "192.168.100.0/24"
    name: "ansible_network_vpc_test"
  register: vpc
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create subnet
  hwc_vpc_subnet:
    gateway_ip: "192.168.100.32"
    name: "ansible_network_subnet_test"
    dhcp_enable: true
    vpc_id: "{{ vpc.id }}"
    cidr: "192.168.100.0/26"
  register: subnet
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a port
  community.general.hwc_vpc_port:
    subnet_id: "{{ subnet.id }}"
    ip_address: "192.168.100.33"

Inputs

    
id:
    description:
    - The ID of resource to be managed.
    type: str

name:
    description:
    - Specifies the port name. The value can contain no more than 255 characters.
    required: false
    type: str

user:
    description:
    - The user name to login with.
    - Currently only user names are supported, and not user IDs.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the given object should exist in Huawei Cloud.
    type: str

domain:
    description:
    - The name of the Domain to scope to (Identity v3).
    - Currently only domain names are supported, and not domain IDs.
    required: true
    type: str

region:
    description:
    - The region to which the project belongs.
    type: str

project:
    description:
    - The name of the Tenant (Identity v2) or Project (Identity v3).
    - Currently only project names are supported, and not project IDs.
    required: true
    type: str

password:
    description:
    - The password to login with.
    required: true
    type: str

timeouts:
    default: {}
    description:
    - The timeouts for each operations.
    suboptions:
      create:
        default: 15m
        description:
        - The timeouts for create operation.
        type: str
    type: dict

subnet_id:
    description:
    - Specifies the ID of the subnet to which the port belongs.
    required: true
    type: str

ip_address:
    description:
    - Specifies the port IP address.
    required: false
    type: str

admin_state_up:
    description:
    - Specifies the administrative state of the port.
    required: false
    type: bool

extra_dhcp_opts:
    description:
    - Specifies the extended option of DHCP.
    elements: dict
    required: false
    suboptions:
      name:
        description:
        - Specifies the option name.
        required: false
        type: str
      value:
        description:
        - Specifies the option value.
        required: false
        type: str
    type: list

security_groups:
    description:
    - Specifies the ID of the security group.
    elements: str
    required: false
    type: list

identity_endpoint:
    description:
    - The Identity authentication URL.
    required: true
    type: str

allowed_address_pairs:
    description:
    - Specifies a set of zero or more allowed address pairs.
    elements: dict
    required: false
    suboptions:
      ip_address:
        description:
        - Specifies the IP address. It cannot set it to 0.0.0.0. Configure an independent
          security group for the port if a large CIDR block (subnet mask less than 24)
          is configured for parameter allowed_address_pairs.
        required: false
        type: str
      mac_address:
        description:
        - Specifies the MAC address.
        required: false
        type: str
    type: list

Outputs

admin_state_up:
  description:
  - Specifies the administrative state of the port.
  returned: success
  type: bool
allowed_address_pairs:
  contains:
    ip_address:
      description:
      - Specifies the IP address. It cannot set it to 0.0.0.0. Configure an independent
        security group for the port if a large CIDR block (subnet mask less than 24)
        is configured for parameter allowed_address_pairs.
      returned: success
      type: str
    mac_address:
      description:
      - Specifies the MAC address.
      returned: success
      type: str
  description:
  - Specifies a set of zero or more allowed address pairs.
  returned: success
  type: list
extra_dhcp_opts:
  contains:
    name:
      description:
      - Specifies the option name.
      returned: success
      type: str
    value:
      description:
      - Specifies the option value.
      returned: success
      type: str
  description:
  - Specifies the extended option of DHCP.
  returned: success
  type: list
ip_address:
  description:
  - Specifies the port IP address.
  returned: success
  type: str
mac_address:
  description:
  - Specifies the port MAC address.
  returned: success
  type: str
name:
  description:
  - Specifies the port name. The value can contain no more than 255 characters.
  returned: success
  type: str
security_groups:
  description:
  - Specifies the ID of the security group.
  returned: success
  type: list
subnet_id:
  description:
  - Specifies the ID of the subnet to which the port belongs.
  returned: success
  type: str