community / community.general / 2.5.9 / module / hwc_vpc_port Creates a resource of Vpc/Port in Huawei Cloud | "added in version" 0.2.0 of community.general" Authors: Huawei Inc. (@huaweicloud)community.general.hwc_vpc_port (2.5.9) — module
Install with ansible-galaxy collection install community.general:==2.5.9
collections: - name: community.general version: 2.5.9
vpc port management.
# create a port - name: Create vpc hwc_network_vpc: cidr: "192.168.100.0/24" name: "ansible_network_vpc_test" register: vpc
- 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
- name: Create a port community.general.hwc_vpc_port: subnet_id: "{{ subnet.id }}" ip_address: "192.168.100.33"
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: 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
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