community.general.hwc_vpc_route – Creates a resource of Vpc/Route in Huawei Cloud¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.hwc_vpc_route
.
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¶
Notes¶
Note
If id option is provided, it takes precedence over destination, vpc_id, type and next_hop for route selection.
destination, vpc_id, type and next_hop are used for route selection. If more than one route with this options exists, execution is aborted.
No parameter support updating. If one of option is changed, the module will create a new resource.
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 a peering connect
- name: Create a local vpc
hwc_network_vpc:
cidr: "192.168.0.0/16"
name: "ansible_network_vpc_test_local"
register: vpc1
- name: Create a peering vpc
hwc_network_vpc:
cidr: "192.168.0.0/16"
name: "ansible_network_vpc_test_peering"
register: vpc2
- name: Create a peering connect
hwc_vpc_peering_connect:
local_vpc_id: "{{ vpc1.id }}"
name: "ansible_network_peering_test"
filters:
- "name"
peering_vpc:
vpc_id: "{{ vpc2.id }}"
register: connect
- name: Create a route
community.general.hwc_vpc_route:
vpc_id: "{{ vpc1.id }}"
destination: "192.168.0.0/16"
next_hop: "{{ connect.id }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Huawei Inc. (@huaweicloud)