community.general.hwc_vpc_eip – Creates a resource of Vpc/EIP in Huawei Cloud
Note
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.hwc_vpc_eip
.
New in version 0.2.0: of community.general
Requirements
The below requirements are needed on the host that executes this module.
keystoneauth1 >= 3.6.0
Parameters
Parameter |
Comments |
---|---|
Specifies the dedicated bandwidth object. |
|
Specifies whether the bandwidth is billed by traffic or by bandwidth size. The value can be bandwidth or traffic. If this parameter is left blank or is null character string, default value bandwidth is used. For IPv6 addresses, the default parameter value is bandwidth outside China and is traffic in China. |
|
Specifies the bandwidth name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores |
|
Specifies the bandwidth size. The value ranges from 1 Mbit/s to 2000 Mbit/s by default. (The specific range may vary depending on the configuration in each region. You can see the bandwidth range of each region on the management console.) The minimum unit for bandwidth adjustment varies depending on the bandwidth range. The details are as follows. The minimum unit is 1 Mbit/s if the allowed bandwidth size ranges from 0 to 300 Mbit/s (with 300 Mbit/s included). The minimum unit is 50 Mbit/s if the allowed bandwidth size ranges 300 Mbit/s to 1000 Mbit/s (with 1000 Mbit/s included). The minimum unit is 500 Mbit/s if the allowed bandwidth size is greater than 1000 Mbit/s. |
|
The name of the Domain to scope to (Identity v3). (currently only domain names are supported, and not domain IDs). |
|
Specifies the enterprise project ID. |
|
The id of resource to be managed. |
|
The Identity authentication URL. |
|
The value can be 4 (IPv4 address) or 6 (IPv6 address). If this parameter is left blank, an IPv4 address will be assigned. |
|
Specifies the obtained IPv4 EIP. The system automatically assigns an EIP if you do not specify it. |
|
The password to login with. |
|
Specifies the port ID. This parameter is returned only when a private IP address is bound with the EIP. |
|
The name of the Tenant (Identity v2) or Project (Identity v3). (currently only project names are supported, and not project IDs). |
|
The region to which the project belongs. |
|
Specifies the ID of shared bandwidth. |
|
Whether the given object should exist in Huawei Cloud. Choices:
|
|
The timeouts for each operations. |
|
The timeouts for create operation. Default: “5m” |
|
The timeouts for update operation. Default: “5m” |
|
Specifies the EIP type. |
|
The user name to login with (currently only user names are supported, and not user IDs). |
Notes
Note
For authentication, you can set identity_endpoint using the
ANSIBLE_HWC_IDENTITY_ENDPOINT
env variable.For authentication, you can set user using the
ANSIBLE_HWC_USER
env variable.For authentication, you can set password using the
ANSIBLE_HWC_PASSWORD
env variable.For authentication, you can set domain using the
ANSIBLE_HWC_DOMAIN
env variable.For authentication, you can set project using the
ANSIBLE_HWC_PROJECT
env variable.For authentication, you can set region using the
ANSIBLE_HWC_REGION
env variable.Environment variables values will only be used if the playbook values are not set.
Examples
# create an eip and bind it to 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
hwc_vpc_port:
subnet_id: "{{ subnet.id }}"
ip_address: "192.168.100.33"
register: port
- name: Create an eip and bind it to a port
community.general.hwc_vpc_eip:
type: "5_bgp"
dedicated_bandwidth:
charge_mode: "traffic"
name: "ansible_test_dedicated_bandwidth"
size: 1
port_id: "{{ port.id }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Specifies the time (UTC time) when the EIP was assigned. Returned: success |
|
Specifies the dedicated bandwidth object. Returned: success |
|
Specifies whether the bandwidth is billed by traffic or by bandwidth size. The value can be bandwidth or traffic. If this parameter is left blank or is null character string, default value bandwidth is used. For IPv6 addresses, the default parameter value is bandwidth outside China and is traffic in China. Returned: success |
|
Specifies the ID of dedicated bandwidth. Returned: success |
|
Specifies the bandwidth name. The value is a string of 1 to 64 characters that can contain letters, digits, underscores Returned: success |
|
Specifies the bandwidth size. The value ranges from 1 Mbit/s to 2000 Mbit/s by default. (The specific range may vary depending on the configuration in each region. You can see the bandwidth range of each region on the management console.) The minimum unit for bandwidth adjustment varies depending on the bandwidth range. The details are as follows:. The minimum unit is 1 Mbit/s if the allowed bandwidth size ranges from 0 to 300 Mbit/s (with 300 Mbit/s included). The minimum unit is 50 Mbit/s if the allowed bandwidth size ranges 300 Mbit/s to 1000 Mbit/s (with 1000 Mbit/s included). The minimum unit is 500 Mbit/s if the allowed bandwidth size is greater than 1000 Mbit/s. Returned: success |
|
Specifies the enterprise project ID. Returned: success |
|
The value can be 4 (IPv4 address) or 6 (IPv6 address). If this parameter is left blank, an IPv4 address will be assigned. Returned: success |
|
Specifies the obtained IPv4 EIP. The system automatically assigns an EIP if you do not specify it. Returned: success |
|
Specifies the obtained IPv6 EIP. Returned: success |
|
Specifies the port ID. This parameter is returned only when a private IP address is bound with the EIP. Returned: success |
|
Specifies the private IP address bound with the EIP. This parameter is returned only when a private IP address is bound with the EIP. Returned: success |
|
Specifies the ID of shared bandwidth. Returned: success |
|
Specifies the EIP type. Returned: success |
Authors
Huawei Inc. (@huaweicloud)