Ansible and EC2 Auto-Scaling

We are slowly starting our migration away from Puppet towards Ansible and have a use case I’d like the community’s feedback on. Some notes to frame the question:

  1. Puppet isn’t going away immediately. We still have legacy code/infrastructure (who doesn’t).
  2. Ansible can’t break Puppet and vice versa.
  3. DNS records have to be created for new hosts (puppet, ya know).

And now the question(s):

  1. How can I make Ansible aware EC2 auto-scaling has created new systems?
  2. How can I get Ansible to assign consistent host names and DNS records (Route 53) automatically?

Chris I haven’t gotten this far yet so YMMV…see inline

And now the question(s):

  1. How can I make Ansible aware EC2 auto-scaling has created new systems?

I think you are looking for the concept of the Dynamic Inventory
http://docs.ansible.com/ansible/intro_dynamic_inventory.html#example-aws-ec2-external-inventory-script

  1. How can I get Ansible to assign consistent host names and DNS records (Route 53) automatically?

For this I think you’d want to do something like this:
https://aws.amazon.com/blogs/compute/building-a-dynamic-dns-for-route-53-using-cloudwatch-events-and-lambda/

An similar example of how to setup CloudWatch Events and Lambda Functions with Ansible:
https://gist.github.com/danvaida/e369838ceaa65a7a6f57de7d08af805f
Note this requires features merged but not available yet until 2.2 gets released.