# Update aws ec2 autoscaling group with ansible

**URL:** <https://forum.ansible.com/t/update-aws-ec2-autoscaling-group-with-ansible/18304>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [May 26, 2015, 2:08am UTC](https://forum.ansible.com/t/update-aws-ec2-autoscaling-group-with-ansible/18304 "2015-05-26T02:08:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno\_Galindro\_da\_Co](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@Bruno\_Galindro\_da\_Co](https://forum.ansible.com/u/Bruno_Galindro_da_Co)\
**Post date:** [May 26, 2015, 2:08am UTC](https://forum.ansible.com/t/update-aws-ec2-autoscaling-group-with-ansible/18304/1 "2015-05-26T02:08:44Z")

</div>

I have an autoscaling group with two hosts running. Both of them have the same ec2 tags. I need to use ec2.py (dynamic inventory) for retrieve the hosts associated with the autoscaling group.

What I need is:  
1 - run ansible tasks in only one host of the autoscaling group  
2 - create a new ami from that host  
3 - create a new launch configuration point to the created ami  
4 - update the autoscaling group with new launch configuration  
5 - execute a rolling autoscaling group update  
6 - exit

How can I do this??
