Documentation

ali_route_entry_facts - Gather facts on vrouter of Alibaba Cloud.

New in version 1.5.0.

Synopsis

  • This module fetches data from the Open API in Alicloud. The module must be called from within the VRouter itself.

Requirements

The below requirements are needed on the host that executes this module.

  • footmark
  • python >= 2.6

Parameters

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
route_table_id
The ID of the route table.
vrouter_id
Id of vrouter of vpc

aliases: id

Notes

Note

  • If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence ALICLOUD_ACCESS_KEY or ALICLOUD_ACCESS_KEY_ID, ALICLOUD_SECRET_KEY or ALICLOUD_SECRET_ACCESS_KEY, ALICLOUD_REGION or ALICLOUD_REGION_ID, ALICLOUD_SECURITY_TOKEN
  • ALICLOUD_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

Examples

# Fetch vrouter details according to setting different filters
- name: Fetch vroute entry details example
  hosts: localhost
  connection: local
  vars:
    alicloud_access_key: <your-alicloud-access-key>
    alicloud_secret_key: <your-alicloud-secret-key>
    alicloud_region: cn-beijing
    vrouter_id: xxxxxxxxxxxxx
    route_table_id: xxxxxxxxxxxxx

  tasks:
    - name: Find all vroute_entries in the specified vroute
      ali_route_entry_facts:
        alicloud_access_key: '{{ alicloud_access_key }}'
        alicloud_secret_key: '{{ alicloud_secret_key }}'
        alicloud_region: '{{ alicloud_region }}'
        vrouter_id: '{{ vrouter_id }}'
      register: result
    - debug: var=result

    - name: Find all vroute_entries in the specified vroute by route table id
      ali_route_entry_facts:
        alicloud_access_key: '{{ alicloud_access_key }}'
        alicloud_secret_key: '{{ alicloud_secret_key }}'
        alicloud_region: '{{ alicloud_region }}'
        vrouter_id: '{{ vrouter_id }}'
        route_table_id: '{{ route_table_id }}'
      register: result_by_tbl_id
    - debug: var=result_by_tbl_id

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
total
int
when success
The number of all route entries in vrouter.

Sample:
3
vroute_entries
list
when success
Details about the VRouter that were created.

Sample:
[{'status': 'Available', 'next_hop_type': 'local', 'tags': {}, 'region': 'cn-beijing', 'next_hops': {'next_hop': []}, 'instance_id': '', 'route_table_id': 'vtb-2ze1rxml89cl7828yc08g', 'type': 'System', 'destination_cidr_block': '192.168.5.0/28'}, {'status': 'Available', 'next_hop_type': 'local', 'tags': {}, 'region': 'cn-beijing', 'next_hops': {'next_hop': []}, 'instance_id': '', 'route_table_id': 'vtb-2ze1rxml89cl7828yc08g', 'type': 'System', 'destination_cidr_block': '192.168.1.0/24'}, {'status': 'Available', 'next_hop_type': 'service', 'tags': {}, 'region': 'cn-beijing', 'next_hops': {'next_hop': []}, 'instance_id': '', 'route_table_id': 'vtb-2ze1rxml89cl7828yc08g', 'type': 'System', 'destination_cidr_block': '100.64.0.0/10'}]
vrouter_id
str
when success
VRouter id after operating VRouter.

Sample:
vrt-2ze60agfbr2wcyt08jfov


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • He Guimin (@xiaozhu36)

Hint

If you notice any issues in this documentation you can edit this document to improve it.