opentelekomcloud.cloud.as_config module -- Create/Remove AutoScaling configuration 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_config.

New in opentelekomcloud.cloud 0.2.0

Synopsis

  • Create/Remove AutoScaling configuration 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

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.

ca_cert

aliases: cacert

string

A path to a CA Cert bundle that can be used as part of verifying SSL API requests.

client_cert

aliases: cert

string

A path to a client certificate to use as part of the SSL transaction.

client_key

aliases: key

string

A path to a client key to use as part of the SSL transaction.

cloud

any

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.

disk

list / elements=dictionary

Specifies the disk group information. System disks are mandatory and data disks are optional.

data_disk_image_id

string

Specifies the ID of a data disk image used to export data disks of an ECS.

dedicated_storage_id

string

Specifies a DSS device ID for creating an ECS disk.

disk_type

string / required

Specifies a disk type.

Mandatory.

Choices:

  • "data"

  • "sys"

metadata

dictionary

Specifies the metadata for creating disks.

__system__cmkid

string

Specifies the CMK ID, which indicates encryption in metadata. This parameter is used with __system__encrypted.

__system__encrypted

string

Specifies encryption in metadata. The value can be 0 (encryption disabled) or 1 (encryption enabled).

Choices:

  • "0" ← (default)

  • "1"

size

integer / required

Specifies the disk size. The unit is GB.

Mandatory.

snapshot_id

string

Specifies the disk backup snapshot ID for restoring the system disk and data disks using a full-ECS backup when a full-ECS image is used.

volume_type

string / required

Specifies the ECS system disk type.

Mandatory.

Choices:

  • "sata"

  • "sas"

  • "ssd"

  • "co-p1"

  • "uh-l1"

flavor

string

Specifies the ECS flavor ID or name. A maximum of 10 flavors can be selected. Use a comma (,) to separate multiple flavor IDs.

image

string

Specifies the image ID or name. Its value is the same as that of image_id for specifying the image selected during ECS creation.

instance_id

string

Specifies the ECS ID.

When using the existing ECS specifications as the template to create AS configurations, specify this parameter. In this case, the flavorRef, imageRef, disk, and security_groups fields do not take effect.

If not specified, flavorRef, imageRef, and disk fields are mandatory.

interface

aliases: endpoint_type

string

Endpoint URL type to fetch from the service catalog.

Choices:

  • "admin"

  • "internal"

  • "public" ← (default)

key_name

string

Specifies the name of the SSH key pair used to log in to the ECS.

Mandatory for creating.

metadata

dictionary

Specifies the ECS metadata.

admin_pass

string

Specifies the initial login password of the administrator account for logging in to an ECS using password authentication. The Linux administrator is root, and the Windows administrator is Administrator.

personality

list / elements=dictionary

Specifies information about the injected file. Only text files can be injected. A maximum of five files can be injected at a time and the maximum size of each file is 1 KB.

content

string / required

Specifies the content of the injected file.

Mandatory.

path

string / required

Specifies the path of the injected file.

Mandatory.

public_ip

dictionary

Specifies the EIP of the ECS.

The EIP can be configured in two ways. 1.Do not use an EIP. 2. Automatically assign an EIP. You need to specify the information about the new EIP.

eip

dictionary / required

Specifies the EIP automatically assigned to the ECS.

Mandatory.

bandwidth

dictionary / required

Specifies the bandwidth of an IP address.

Mandatory.

charging_mode

string / required

Specifies the bandwidth billing mode.

Mandatory.

share_type

string / required

Specifies the bandwidth sharing type.

Mandatory.

size

integer / required

Specifies the bandwidth (Mbit/s).

Mandatory.

ip_type

string / required

Specifies the EIP type.

Mandatory.

region_name

string

Name of the region.

scaling_configuration

string / required

Specifies the AS configuration name.

It can be only 'name' in order to create AS configuration. It can be 'name' or 'id' in order to delete.

Mandatory.

sdk_log_level

string

Log level of the OpenStackSDK

Choices:

  • "ERROR"

  • "WARN" ← (default)

  • "INFO"

  • "DEBUG"

sdk_log_path

string

Path to the logfile of the OpenStackSDK. If empty no log is written

security_groups

list / elements=dictionary

Specifies security groups.

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 ID of the security group.

Mandatory.

state

string

Whether resource should be present or absent.

Choices:

  • "present" ← (default)

  • "absent"

timeout

integer

How long should ansible wait for the requested resource.

Default: 180

user_data

string

Specifies the user data to be injected during the ECS creation process. Text, text files, and gzip files can be injected.

The content to be injected must be encoded with base64. The maximum size of the content to be injected (before encoding) is 32 KB.

validate_certs

aliases: verify

boolean

Whether or not SSL API requests should be verified.

Before Ansible 2.3 this defaulted to yes.

Choices:

  • false

  • true

wait

boolean

Should ansible wait until the requested resource is complete.

Choices:

  • false

  • true ← (default)

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 configuration.
opentelekomcloud.cloud.as_config:
    scaling_configuration_name: "as-config-test2"
    key_name: "as-config-test"
    image: "9e4322d2-fc79-4d20-966b-41ff78fb7c48"
    flavor: "c4.2xlarge.2"
    disk:
        - size: 10
          volume_type: 'sas'
          disk_type: 'sys'
        - size: 10
          volume_type: 'sas'
          disk_type: 'data'

Return Values

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

Key

Description

as_group

complex

AS groups object.

Returned: On Success.

scaling_configuration_id

string

Specifies the AS configuration ID.

Returned: success

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

Authors

  • Polina Gubina (@Polina-Gubina)