Deprecated

Removed in 9.0.0

i

Reason:This module relies on the deprecated package pyrax. | Alternative:Use the Openstack modules instead.

community.general.rax_scaling_policy (8.5.0) — module

Manipulate Rackspace Cloud Autoscale Scaling Policy

Authors: Matt Martz (@sivel)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manipulate Rackspace Cloud Autoscale Scaling Policy


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- hosts: localhost
  gather_facts: false
  connection: local
  tasks:
    - community.general.rax_scaling_policy:
        credentials: ~/.raxpub
        region: ORD
        at: '2013-05-19T08:07:08Z'
        change: 25
        cooldown: 300
        is_percent: true
        name: ASG Test Policy - at
        policy_type: schedule
        scaling_group: ASG Test
      register: asps_at

    - community.general.rax_scaling_policy:
        credentials: ~/.raxpub
        region: ORD
        cron: '1 0 * * *'
        change: 25
        cooldown: 300
        is_percent: true
        name: ASG Test Policy - cron
        policy_type: schedule
        scaling_group: ASG Test
      register: asp_cron

    - community.general.rax_scaling_policy:
        credentials: ~/.raxpub
        region: ORD
        cooldown: 300
        desired_capacity: 5
        name: ASG Test Policy - webhook
        policy_type: webhook
        scaling_group: ASG Test
      register: asp_webhook

Inputs

    
at:
    description:
    - The UTC time when this policy will be executed. The time must be formatted according
      to C(yyyy-MM-dd'T'HH:mm:ss.SSS) such as V(2013-05-19T08:07:08Z)
    type: str

env:
    description:
    - Environment as configured in C(~/.pyrax.cfg), see U(https://github.com/rackspace/pyrax/blob/master/docs/getting_started.md#pyrax-configuration).
    type: str

cron:
    description:
    - The time when the policy will be executed, as a cron entry. For example, if this
      is parameter is set to V(1 0 * * *).
    type: str

name:
    description:
    - Name to give the policy
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicate desired state of the resource
    type: str

change:
    description:
    - The change, either as a number of servers or as a percentage, to make in the scaling
      group. If this is a percentage, you must set O(is_percent) to V(true) also.
    type: int

region:
    description:
    - Region to create an instance in.
    type: str

api_key:
    aliases:
    - password
    description:
    - Rackspace API key, overrides O(credentials).
    type: str

cooldown:
    default: 300
    description:
    - The period of time, in seconds, that must pass before any scaling can occur after
      the previous scaling. Must be an integer between 0 and 86400 (24 hrs).
    type: int

username:
    description:
    - Rackspace username, overrides O(credentials).
    type: str

tenant_id:
    description:
    - The tenant ID used for authentication.
    type: str

is_percent:
    default: false
    description:
    - Whether the value in O(change) is a percent value
    type: bool

credentials:
    aliases:
    - creds_file
    description:
    - File to find the Rackspace credentials in. Ignored if O(api_key) and O(username)
      are provided.
    type: path

policy_type:
    choices:
    - webhook
    - schedule
    description:
    - The type of policy that will be executed for the current release.
    required: true
    type: str

tenant_name:
    description:
    - The tenant name used for authentication.
    type: str

auth_endpoint:
    description:
    - The URI of the authentication service.
    - If not specified will be set to U(https://identity.api.rackspacecloud.com/v2.0/).
    type: str

identity_type:
    default: rackspace
    description:
    - Authentication mechanism to use, such as rackspace or keystone.
    type: str

scaling_group:
    description:
    - Name of the scaling group that this policy will be added to
    required: true
    type: str

validate_certs:
    aliases:
    - verify_ssl
    description:
    - Whether or not to require SSL validation of API endpoints.
    type: bool

desired_capacity:
    description:
    - The desired server capacity of the scaling the group; that is, how many servers
      should be in the scaling group.
    type: int