opentelekomcloud.cloud.as_group module -- Create/Update/Remove AutoScaling group from the OTC¶
Note
This module is part of the opentelekomcloud.cloud collection (version 0.14.6).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install opentelekomcloud.cloud
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: opentelekomcloud.cloud.as_group
.
New in opentelekomcloud.cloud 0.2.0
Synopsis¶
Create/Update/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 |
Comments |
---|---|
Specifies a flag for enabling or disabling an AS group. Choices:
|
|
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. |
|
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. |
|
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. |
|
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. |
|
A path to a CA Cert bundle that can be used as part of verifying SSL API requests. |
|
A path to a client certificate to use as part of the SSL transaction. |
|
A path to a client key to use as part of the SSL transaction. |
|
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. |
|
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: |
|
Specifies whether to delete the EIP bound to the ECS when deleting the ECS. The default value is false. Choices:
|
|
Specifies whether to delete the data disks attached to the ECS when deleting the ECS. The default value is false. Choices:
|
|
Specifies the expected number of instances. The default value is the minimum number of instances. Default: |
|
Specifies whether to forcibly delete an AS group, remove the ECS instances and release them when the AS group is running instances or performing scaling actions. Choices:
|
|
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: |
|
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. Choices:
|
|
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: |
|
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. Choices:
|
|
Endpoint URL type to fetch from the service catalog. Choices:
|
|
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. |
|
Specifies information about an enhanced load balancer. Mandatory when 'lb_listener' is not specified. |
|
Specifies the backend ECS group ID. |
|
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. |
|
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. |
|
Specifies the maximum number of instances. The default value is 0. Default: |
|
Specifies the minimum number of instances. The default value is 0. Default: |
|
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. Choices:
|
|
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 AS group. |
|
Specifies the network ID. |
|
Specifies the notification mode. |
|
Name of the region. |
|
The router ID or name. Mandatory for creating AS group. |
|
The AS configuration ID or name. |
|
Name or ID of the AS Group. |
|
Specifies the AS Group ID. Mandatory for updating and deleting AS Group. |
|
Specifies the AS Group name. Mandatory for creating AS Group. |
|
Log level of the OpenStackSDK Choices:
|
|
Path to the logfile of the OpenStackSDK. If empty no log is written |
|
A maximum of one security group can be selected. 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. |
|
Specifies the security group ID. |
|
Whether resource should be present or absent. Choices:
|
|
The duration in seconds that module should wait. Default: |
|
Whether or not SSL API requests should be verified. Before Ansible 2.3 this defaulted to Choices:
|
|
If the module should wait for the AS Group to be created or deleted. Choices:
|
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¶
#Create AS Group
- opentelekomcloud.cloud.as_group:
scaling_group:
name: "as_group_test"
networks:
- id: "a64b4561-af18-4440-9976-b2398ed39ce5"
router: "5d1ac1f4-bec6-4b8c-aae0-7c4345c68f5d"
scaling_configuration: "as_config_test"
desire_instance_number: 1
max_instance_number: 1
action: "resume"
state: "present"
wait: true
timeout: 360
register: result
#Delete AS Group
- opentelekomcloud.cloud.as_group:
scaling_group:
name: "as_group_test"
state: "absent"
force_delete: true
wait: true
timeout: 360
register: result
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
AS groups object. Returned: On Success. |
|
Specifies the AS group ID. Returned: success Sample: |