New in version 1.5.0.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| alicloud_access_key |
Aliyun Cloud access key. If not set then the value of environment variable
ALICLOUD_ACCESS_KEY, ALICLOUD_ACCESS_KEY_ID will be used instead.aliases: access_key_id, access_key |
|
| alicloud_region |
The Aliyun Cloud region to use. If not specified then the value of environment variable
ALICLOUD_REGION, ALICLOUD_REGION_ID will be used instead.aliases: region, region_id |
|
| alicloud_secret_key |
Aliyun Cloud secret key. If not set then the value of environment variable
ALICLOUD_SECRET_KEY, ALICLOUD_SECRET_ACCESS_KEY will be used instead.aliases: secret_access_key, secret_key |
|
| alicloud_security_token |
The Aliyun Cloud security token. If not specified then the value of environment variable
ALICLOUD_SECURITY_TOKEN will be used instead.aliases: security_token |
|
| destination_cidrblock |
The destination CIDR or Ip address of route entry. Such as:192.168.0.0/24 or 192.168.0.1. There is not the same destination cidr_block in the same route table. It is required when creating route entry.
aliases: dest_cidrblock, cidr_block |
|
| nexthop_id |
The next hop ID of route entry. It is required when creating a route entry.
aliases: hop_id |
|
| nexthop_type |
|
The next hop type of route entry.
aliases: hop_type |
|
router_id
required |
The ID of virtual router to which route entry belongs.
|
|
| state |
|
Whether or not to create, delete route entry.
|
Note
ALICLOUD_ACCESS_KEY or ALICLOUD_ACCESS_KEY_ID, ALICLOUD_SECRET_KEY or ALICLOUD_SECRET_ACCESS_KEY, ALICLOUD_REGION or ALICLOUD_REGION_ID, ALICLOUD_SECURITY_TOKENALICLOUD_REGION or ALICLOUD_REGION_ID can be typically be used to specify the ALICLOUD region, when required, but this can also be configured in the footmark config file# basic provisioning example to create custom route
- name: create route entry
hosts: localhost
connection: local
vars:
alicloud_region: cn-hongkong
state: present
cidr_block: '192.168.4.0/24'
nexthop_id: 'xxxxxxxxxx'
router_id: 'XXXXXXXX'
tasks:
- name: create route entry
ali_route_entry:
alicloud_region: '{{ alicloud_region }}'
state: '{{ state }}'
destination_cidrblock: '{{ cidr_block }}'
nexthop_id: '{{ nexthop_id }}'
router_id: 'XXXXXXXX'
register: result
- debug: var=result
# basic provisioning example to delete custom route
- name: delete route entry
hosts: localhost
connection: local
vars:
alicloud_region: cn-hongkong
destination_cidrblock: "192.168.4.0/24"
next_hop_id: "xxxxxxxxxx"
router_id: 'XXXXXXXX'
state: present
tasks:
- name: delete route
ali_route_entry:
alicloud_region: '{{ alicloud_region }}'
destination_cidrblock: '{{ cidr_block }}'
nexthop_id: '{{ nexthop_id }}'
router_id: 'XXXXXXXX'
state: '{{ state }}'
register: result
- debug: var=result
# basic provisioning example to querying route entries
- name: get route entry list
hosts: localhost
connection: local
vars:
alicloud_region: cn-hongkong
router_id: xxxxxxxxxx
state: list
tasks:
- name: get vrouter list
ali_route_entry:
alicloud_region: '{{ alicloud_region }}'
router_id: '{{ router_id }}'
state: '{{ state }}'
register: result
- debug: var=result
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
destination_cidrblock
string
|
on present and absent |
the destination CIDR block of route entry
Sample:
10.0.14.0/24
|
|
destination_cidrblocks
list
|
on list |
the list destination CIDR blocks of route entries in one route table
Sample:
['10.0.14.0/24', '10.0.13.0/24', '100.64.0.0/10']
|
|
route_entries
list
|
on list |
Details about the ecs route entries that were retrieved in one route table.
Sample:
[{'status': 'Available', 'destination_cidrblock': '10.0.14.0/24', 'nexthop_id': 'i-2zejbnp5zv525per4g84', 'route_table_id': 'vtb-2zeeokge820zn0kqawmi9', 'type': 'Custom', 'nexthop_type': 'Instance'}, {'status': 'Available', 'destination_cidrblock': '10.0.13.0/24', 'nexthop_id': '', 'route_table_id': 'vtb-2zeeokge820zn0kqawmi9', 'type': 'System', 'nexthop_type': 'local'}]
|
|
route_entry
dict
|
on present |
Details about the ecs route entry that was created.
Sample:
{'status': 'Available', 'destination_cidrblock': '10.0.14.0/24', 'nexthop_id': 'i-2zejbnp5zv525per4g84', 'route_table_id': 'vtb-2zeeokge820zn0kqawmi9', 'type': 'Custom', 'nexthop_type': 'Instance'}
|
|
route_table_id
string
|
on present and absent |
the ID of route table to which route entry belongs
Sample:
vtb-2zemlj5nscgoicjnxes7h
|
|
total
int
|
on list |
The number of all route entries after retrieving route entry.
Sample:
3
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.