For Ansible 1.9-develop Pull request 601 
<https://github.com/ansible/ansible-modules-core/pull/601> had the fix for 
Issue 383, which does affect our production ASG about every two weeks or 
so. We use the ec2_asg module to refresh our ASG instances 3 times a day. 

I was eager to test. In doing so, I noticed that the replace_all_instances 
or replace_instances options cause extra set of scaling events. Has anyone 
else who uses either replace_ option see this happen? See below for the 
screen shot which demonstrates the behavior.

We have one instance in two different Availability Zones. So we use a batch 
size of two (actually a formula based upon the length of the 
availability_zones list of the ASG). 

Interesting... I just tested with batch_size: 1. The extra set of scaling 
events was 1. I.e. one new instance launched and one new instance 
terminated.

The batch_size logic is broken. I am going open an Issue in 
*ansible-modules-core*, but welcome others to note their experience here. 
I'll update this topic with a link to the Issue, too.

    - name: Retrieve Auto Scaling Group properties
      local_action:
        module: ec2_asg
        name: "{{ asg_name }}"
        state: present
        health_check_type: ELB
      register: result_asg

    - name: Auto Scaling Group properties
      debug: var=result_asg

    - name: Replace current instances with fresh instances
      local_action:
        module: ec2_asg
        name: "{{ asg_name }}"
        state: present
        min_size: "{{ result_asg.min_size }}"
        max_size: "{{ result_asg.max_size }}"
        desired_capacity: "{{ result_asg.desired_capacity }}"
        health_check_type: "{{ result_asg.health_check_type }}"
        lc_check: no
        replace_all_instances: yes
        replace_batch_size: "{{ result_asg.availability_zones | length() }}"





1. and 2. are expected. a. - d. are extra scaling events.

<https://lh3.googleusercontent.com/-1bvOCHDYhjU/VRK3Bkz1O-I/AAAAAAAAACs/RCDKklA7Hkc/s1600/EC2_Management_Console.jpg>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0feaf279-6475-444c-9216-11e45b046404%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to