Documentation

ali_slb_lb_facts - Gather facts on server load balancer of Alibaba Cloud.

New in version 2.8.

Synopsis

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

Requirements

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

  • footmark >= 1.9.0
  • 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
filters
A dict of filters to apply. Each dict item consists of a filter key and a filter value. The filter keys can be all of request parameters. See https://www.alibabacloud.com/help/doc-detail/27582.htm for parameter details. Filter keys can be same as request parameter name or be lower case and use underscores ("_") or dashes ("-") to connect different words in one parameter. 'LoadBalancerId' will be appended to load_balancer_ids automatically.
load_balancer_ids
A list of load balancer IDs to gather facts for.

aliases: ids
load_balancer_name
(Deprecated) A list of server laod balancer names. New option `name_prefix` instead.

aliases: name
name_prefix
Use a load balancer name prefix to filter load balancers.

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

# Note: These examples do not set authentication details, see the Alibaba Cloud Guide for details.
- name: Retrieving slbs using ids
  ali_slb_lb_facts:
    ids: 'lb-sn33f3'

- name: Filter slb using name_regex
  ali_slb_lb_facts:
    name_prefix: 'ansible-slb'

- name: Retrieving all slbs
  ali_slb_lb_facts:

Return Values

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

Key Returned Description
ids
list
when success
List ids of being fetched slb.

Sample:
['lb-dj1oi1h5l74hg22gsnugf', 'lb-dj1t1xwn0y9zcr90e52i2']
load_balancers
complex
on present
info about the server load balancer that was created or deleted.

  resource_group_id
string
always
The resource group of the load balancer belongs.

Sample:
rg-acfmwvvtg5owavy
  master_zone_id
string
always
The ID of the primary zone.

Sample:
cn-beijing-a
  internet_charge_type
string
always
The load balancer internet charge type

Sample:
PayByTraffic
  tags
complex
always
The load balancer tags

  bandwidth
int
always
The load balancer internet bandwidth

Sample:
5
  create_time
string
always
The time of the load balancer was created

Sample:
2019-01-02T02:37:41Z
  address
string
always
The IP address of the loal balancer

Sample:
47.94.26.126
  address_ipversion
string
always
The IP address version. IPV4 or IPV6.

Sample:
ipv4
  id
string
always
The ID of the load balancer was created. Same as load_balancer_id.

Sample:
lb-2zea9ohgtf
  backend_servers
complex
always
The load balancer's backend servers

    server_id
string
always
The backend server id

Sample:
i-vqunci342
    type
string
always
The backend server type, ecs or eni

Sample:
ecs
    description
string
always
The backend server description

    weight
int
always
The backend server weight

Sample:
100
  pay_type
string
always
The load balancer instance charge type.

Sample:
PostPaid
  slave_zone_id
string
always
The ID of the backup zone

Sample:
cn-beijing-d
  name
string
always
The name of the load balancer was created.

Sample:
ansible-ali_slb_lb
  load_balancer_status
string
always
The load balancer current status.

Sample:
active
  load_balancer_name
string
always
The name of the load balancer was created.

Sample:
ansible-ali_slb_lb
  listeners
complex
always
The listeners of the load balancer.

    listener_port
int
always
The front-end port of the listener that is used to receive incoming traffic and distribute the traffic to the backend servers.

Sample:
22
    listener_protocol
string
always
The frontend protocol used by the SLB instance.

Sample:
tcp
    listener_forward
string
always
Whether to enable listener forwarding.

    forward_port
int
always
The destination listening port. It must be an existing HTTPS listening port.

Sample:
20
  end_time
string
always
The time of the load balancer will be released

Sample:
2999-09-08T16:00:00Z
  load_balancer_id
string
always
The ID of the load balancer was created.

Sample:
lb-2zea9ohgtf
  vpc_id
string
always
The vpc of the load balancer belongs.

Sample:
vpc-fn3nc3
  address_type
string
always
The load balancer internet type

Sample:
internet
  vswitch_id
string
always
The vswitch of the load balancer belongs.

Sample:
vsw-c3nc3r
  network_type
string
always
The network type of the load balancer was created.

Sample:
classic
names
list
when success
List names of being fetched slb.

Sample:
['ansible-foo', 'ansible-bar']


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.