opentelekomcloud.cloud.as_group (0.14.2) — module

Create/Update/Remove AutoScaling group from the OTC

| "added in version" 0.2.0 of opentelekomcloud.cloud"

Authors: Polina Gubina (@Polina-Gubina), Irina Pereiaslavskaia (@irina-pereiaslavskaia)

Install collection

Install with ansible-galaxy collection install opentelekomcloud.cloud:==0.14.2


Add to requirements.yml

  collections:
    - name: opentelekomcloud.cloud
      version: 0.14.2

Description

Create/Update/Remove AutoScaling group from the OTC.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
#Delete AS Group
 - opentelekomcloud.cloud.as_group:
     scaling_group:
       name: "as_group_test"
     state: "absent"
     force_delete: true
     wait: true
     timeout: 360
   register: result

Inputs

    
auth:
    description:
    - Dictionary containing auth information as needed by the cloud's auth plugin strategy.
      For the default I(password) plugin, this would contain I(auth_url), I(username),
      I(password), I(project_name) and any information about domains (for example, I(os_user_domain_name)
      or I(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.
    type: dict

wait:
    default: 'yes'
    description:
    - If the module should wait for the AS Group to be created or deleted.
    type: bool

cloud:
    description:
    - Named cloud or cloud config to operate against. If I(cloud) is a string, it references
      a named cloud config as defined in an OpenStack clouds.yaml file. Provides default
      values for I(auth) and I(auth_type). This parameter is not needed if I(auth) is
      provided or if OpenStack OS_* environment variables are present. If I(cloud) is
      a dict, it contains a complete cloud configuration like would be in a section of
      clouds.yaml.
    type: raw

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether resource should be present or absent.
    type: str

action:
    choices:
    - resume
    - pause
    description:
    - Specifies a flag for enabling or disabling an AS group.
    type: str

router:
    description:
    - The router ID or name.
    - Mandatory for creating AS group.
    type: str

ca_cert:
    aliases:
    - cacert
    description:
    - A path to a CA Cert bundle that can be used as part of verifying SSL API requests.
    type: str

timeout:
    default: 200
    description:
    - The duration in seconds that module should wait.
    type: int

networks:
    description:
    - 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.
    elements: dict
    suboptions:
      id:
        description:
        - Specifies the network ID.
        required: true
        type: str
    type: list

auth_type:
    description:
    - 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 I(auth) parameter should be updated accordingly.
    type: str

interface:
    aliases:
    - endpoint_type
    choices:
    - admin
    - internal
    - public
    default: public
    description:
    - Endpoint URL type to fetch from the service catalog.
    type: str

client_key:
    aliases:
    - key
    description:
    - A path to a client key to use as part of the SSL transaction.
    type: str

api_timeout:
    description:
    - 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.
    type: int

client_cert:
    aliases:
    - cert
    description:
    - A path to a client certificate to use as part of the SSL transaction.
    type: str

lb_listener:
    description:
    - 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.
    type: str

region_name:
    description:
    - Name of the region.
    type: str

force_delete:
    default: 'no'
    description:
    - 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.
    type: bool

sdk_log_path:
    description:
    - Path to the logfile of the OpenStackSDK. If empty no log is written
    type: str

delete_volume:
    default: 'no'
    description:
    - Specifies whether to delete the data disks attached to the       ECS when deleting
      the ECS.
    - The default value is false.
    type: bool

notifications:
    description:
    - Specifies the notification mode.
    elements: str
    type: list

scaling_group:
    description:
    - Name or ID of the AS Group.
    required: true
    suboptions:
      id:
        description:
        - Specifies the AS Group ID.
        - Mandatory for updating and deleting AS Group.
        type: str
      name:
        description:
        - Specifies the AS Group name.
        - Mandatory for creating AS Group.
        type: str
    type: dict

sdk_log_level:
    choices:
    - ERROR
    - WARN
    - INFO
    - DEBUG
    default: WARN
    description: Log level of the OpenStackSDK
    type: str

cool_down_time:
    default: 300
    description:
    - 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.
    type: int

validate_certs:
    aliases:
    - verify
    description:
    - Whether or not SSL API requests should be verified.
    - Before Ansible 2.3 this defaulted to C(yes).
    type: bool

delete_publicip:
    default: 'no'
    description:
    - Specifies whether to delete the EIP bound to the ECS when       deleting the ECS.
    - The default value is false.
    type: bool

lbaas_listeners:
    description:
    - Specifies information about an enhanced load balancer.
    - Mandatory when 'lb_listener' is not specified.
    elements: dict
    suboptions:
      pool_id:
        description:
        - Specifies the backend ECS group ID.
        required: true
        type: str
      protocol_port:
        description:
        - 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.
        required: true
        type: int
      weight:
        description:
        - 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.
        required: true
        type: int
    type: list

security_groups:
    description:
    - 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.
    elements: dict
    suboptions:
      id:
        description:
        - Specifies the security group ID.
        required: true
        type: str
    type: list

availability_zones:
    description:
    - 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.
    elements: str
    type: list

max_instance_number:
    default: 0
    description:
    - Specifies the maximum number of instances.
    - The default value is 0.
    type: int

min_instance_number:
    default: 0
    description:
    - Specifies the minimum number of instances.
    - The default value is 0.
    type: int

scaling_configuration:
    description:
    - The AS configuration ID or name.
    type: str

desire_instance_number:
    default: 0
    description:
    - Specifies the expected number of instances.
    - The default value is the minimum number of instances.
    type: int

multi_az_priority_policy:
    choices:
    - equilibrium_distribute
    - pick_first
    default: equilibrium_distribute
    description:
    - 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.
    type: str

instance_terminate_policy:
    choices:
    - old_config_old_instance
    - old_config_new_instance
    - old_instance
    - new_instance
    default: old_config_old_instance
    description:
    - 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.
    type: str

health_periodic_audit_time:
    default: 5
    description:
    - 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.
    type: int

health_periodic_audit_method:
    choices:
    - elb_audit
    - nova_audit
    description:
    - 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.
    type: str

health_periodic_audit_grace_period:
    default: 600
    description:
    - 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.
    type: int

Outputs

as_group:
  contains:
    id:
      description: Specifies the AS group ID.
      sample: 39007a7e-ee4f-4d13-8283-b4da2e037c69
      type: str
  description: AS groups object.
  returned: On Success.
  type: complex