as_group

as_group

Note

This plugin is part of the opentelekomcloud.cloud collection (version 0.0.1).

To install it use: ansible-galaxy collection install opentelekomcloud.cloud.

To use it in a playbook, specify: opentelekomcloud.cloud.as_group.

New in version 0.2.0: of opentelekomcloud.cloud

Synopsis

  • Create/Remove AutoScaling group from the OTC.

Requirements

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

  • openstacksdk

  • openstacksdk >= 0.36.0

  • otcextensions

  • python >= 3.6

Parameters

Parameter Choices/Defaults Comments
api_timeout
integer
How long should the socket layer wait before timing out for API calls. If this is omitted, nothing will be passed to the requests library.
auth
dictionary
Dictionary containing auth information as needed by the cloud's auth plugin strategy. For the default password plugin, this would contain auth_url, username, password, project_name and any information about domains (for example, os_user_domain_name or os_project_domain_name) if the cloud supports them. For other plugins, this param will need to contain whatever parameters that auth plugin requires. This parameter is not needed if a named cloud is provided or OpenStack OS_* environment variables are present.
auth_type
string
Name of the auth plugin to use. If the cloud uses something other than password authentication, the name of the plugin should be indicated here and the contents of the auth parameter should be updated accordingly.
available_zones
list / elements=string
Specifies the AZ information. The ECS associated with a scaling action will be created in a specified AZ. If you do not specify an AZ, the system automatically specifies one.
ca_cert
string
A path to a CA Cert bundle that can be used as part of verifying SSL API requests.

aliases: cacert
client_cert
string
A path to a client certificate to use as part of the SSL transaction.

aliases: cert
client_key
string
A path to a client key to use as part of the SSL transaction.

aliases: key
cloud
raw
Named cloud or cloud config to operate against. If cloud is a string, it references a named cloud config as defined in an OpenStack clouds.yaml file. Provides default values for auth and auth_type. This parameter is not needed if auth is provided or if OpenStack OS_* environment variables are present. If cloud is a dict, it contains a complete cloud configuration like would be in a section of clouds.yaml.
cool_down_time
integer
Specifies the cooldown period (in seconds). The value ranges from 0 to 86400 and is 300 by default.
After a scaling action is triggered, the system starts the cooldown period. During the cooldown period, scaling actions triggered by alarms will be denied. Scheduled, periodic, and manual scaling actions are not affected.
Default is 300.
delete_publicip
boolean
    Choices:
  • no
  • yes
Specifies whether to delete the EIP bound to the ECS when deleting the ECS.
delete_volume
boolean
    Choices:
  • no
  • yes
Specifies whether to delete the data disks attached to the ECS when deleting the ECS.
desire_instance_number
integer
Specifies the expected number of instances. The default value is the minimum number of instances.
enterprise_project_id
string
Specifies the enterprise project ID, which is used to specify the enterprise project to which the AS group belongs.
If the value is 0 or left blank, the AS group belongs to the default enterprise project.
If the value is a UUID, the AS group belongs to the enterprise project corresponding to the UUID.
health_periodic_audit_grace_period
integer
Specifies the grace period for instance health check. The unit is second and value range is 0-86400. The default value is 600. The health check grace period starts after an instance is added to an AS group and is enabled. The AS group will start checking the instance status only after the grace period ends.
This parameter is valid only when the instance health check method of the AS group is ELB_AUDIT.
Default is 600.
health_periodic_audit_method
string
    Choices:
  • elb_audit
  • nova_audit
Specifies the health check method for instances in the AS group. When load balancing is configured for an AS group, the default value is ELB_AUDIT. Otherwise, the default value is NOVA_AUDIT.
ELB_AUDIT indicates the ELB health check, which takes effect in an AS group with a listener.
NOVA_AUDIT indicates the ECS health check, which is the health check method delivered with AS.
health_periodic_audit_time
integer
Specifies the instance health check period. The value can be 1, 5, 15, 60, or 180 in the unit of minutes.
If this parameter is not specified, the default value is 5.
If the value is set to 0, health check is performed every 10 seconds.
Default is 5.
instance_terminate_policy
string
    Choices:
  • old_config_old_instance
  • old_config_new_instance
  • old_instance
  • new_instance
Specifies the instance removal policy.
OLD_CONFIG_OLD_INSTANCE (default). The earlier-created instances based on the earlier-created AS configurations are removed first.
OLD_CONFIG_NEW_INSTANCE. The later-created instances based on the earlier-created AS configurations are removed first.
OLD_INSTANCE. The earlier-created instances are removed first.
NEW_INSTANCE. The later-created instances are removed first.
interface
string
    Choices:
  • admin
  • internal
  • public ←
Endpoint URL type to fetch from the service catalog.

aliases: endpoint_type
lb_listener
string
Specifies ID or name of a classic load balancer listener. The system supports the binding of up to six load balancer listeners, the IDs of which are separated using a comma (,).
Mandatory when 'lbaas_listeners' is not specified.
lbaas_listeners
list / elements=dictionary
Specifies information about an enhanced load balancer.
Mandatory when 'lb_listener' is not specified.
pool_id
string / required
Specifies the backend ECS group ID.
Mandatory.
protocol_port
integer / required
Specifies the backend protocol ID, which is the port on which a backend ECS listens for traffic. The port ID ranges from 1 to 65535.
Mandatory.
weight
integer / required
Specifies the weight, which determines the portion of requests a backend ECS processes when being compared to other backend ECSs added to the same listener.
Mandatory.
max_instance_number
integer
Specifies the maximum number of instances. The default value is 0.
Default is 0.
min_instance_number
integer
Specifies the minimum number of instances. The default value is 0.
Default is 0.
multi_az_priority_policy
string
    Choices:
  • equilibrium_distribute
  • pick_first
Specifies the priority policy used to select target AZs when adjusting the number of instances in an AS group.
EQUILIBRIUM_DISTRIBUTE (default). When adjusting the number of instances, ensure that instances in each AZ in the available_zones list is evenly distributed. If instances cannot be added in the target AZ, select another AZ based on the PICK_FIRST policy.
PICK_FIRST. When adjusting the number of instances, target AZs are determined in the order in the available_zones list.
networks
list / elements=dictionary
Specifies network information. The system supports up to five subnets. The first subnet transferred serves as the primary NIC of the ECS by default.
Mandatory for creation of autoscaling group.
id
string / required
Specifies the network ID.
Mandatory.
notifications
list / elements=string
Specifies the notification mode.
region_name
string
Name of the region.
router
string
The router ID or name.
Mandatory for creating resource.
scaling_configuration
string
The AS configuration ID or name.
scaling_group_id
string
ID the AS group.
scaling_group_name
string
Name of the AS group.
Mandatory for creating autoscaling group.
security_groups
list / elements=dictionary
Specifies the security group. If the security group is specified both in the AS configuration and AS group, the security group specified in the AS configuration prevails.
If the security group is not specified in either of them, the default security group is used.
id
string / required
Specifies the security group ID.
Mandatory.
state
string
    Choices:
  • present ←
  • absent
Whether resource should be present or absent.
timeout
integer
Default:
180
How long should ansible wait for the requested resource.
validate_certs
boolean
    Choices:
  • no ←
  • yes
Whether or not SSL API requests should be verified.
Before Ansible 2.3 this defaulted to yes.

aliases: verify
wait
boolean
    Choices:
  • no
  • yes ←
Should ansible wait until the requested resource is complete.

Notes

Note

  • The standard OpenStack environment variables, such as OS_USERNAME may be used instead of providing explicit values.

  • Auth information is driven by openstacksdk, which means that values can come from a yaml config file in /etc/ansible/openstack.yaml, /etc/openstack/clouds.yaml or ~/.config/openstack/clouds.yaml, then from standard environment variables, then finally by explicit parameters in plays. More information can be found at https://docs.openstack.org/openstacksdk/

Examples

opentelekomcloud.cloud.as_group:
  scaling_group_name: "scaling-group-test"
  networks:
    - id: "39007a7e-ee4f-4d13-8283-b4da2e037c69"
  router: "65707a7e-ee4f-4d13-8283-b4da2e037c69"
register: as_group

Return Values

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

Key Returned Description
as_group
complex
On Success.
AS groups object.

 
scaling_group_id
string
success
Specifies the AS group ID.

Sample:
39007a7e-ee4f-4d13-8283-b4da2e037c69


Authors

  • Polina Gubina (@Polina-Gubina)