Fwd: Using Ansible To Set "DesiredCapacity" In EC2 Autoscaling Group

17 views
Skip to first unread message

Tennis Smith

unread,
Jan 27, 2016, 1:37:06 PM1/27/16
to ansible...@googlegroups.com
Oops.  Posted to wrong group.  Apologies.

On Tuesday, January 26, 2016 at 8:56:49 PM UTC-6, Tennis Smith wrote:

Hi,

I have an autoscaling group which normally has a desired capacity of 0.  It is used only for database restorals.  When we want to do a restore, we set the "DesiredCapacity" to 1. This causes a larger, more powerful, image to start. Once the restore completes, we set the DesiredCapacity back to 0 and the image is taken down. Setting this via the aws cli works fine and has for some time.

So far, I can't get the desired capacity to change the ansible "ec2_scaling_policy" module. Here is one definition I tried 


- name: Prep for autoscaling
hosts: localhost
sudo: no
tasks:
- name: Set autoscaling policy
register: adjust
ec2_scaling_policy:
region: us-east-1
asg_name: "{{rethinkdb_restoral_group}}"
name: "upscale"
state: present
adjustment_type: "DesiredCapacity"
scaling_adjustment: 1
min_adjustment_step: 1

- name: Show status
debug: var=adjust


Output of debug statement above:

TASK [Show status] *************************************************************
ok: [localhost] => {
    "adjust": {
        "adjustment_type": "ChangeInCapacity",
        "arn": "<yadda-yadda>",
        "changed": false,
        "cooldown": null,
        "min_adjustment_step": 1,
        "name": "upscale",
        "scaling_adjustment": 1
    }
}

 The capacity did not change, and the new image did not come up. What am I missing? 

Thanks,
-T





Reply all
Reply to author
Forward
0 new messages