Skip to content

Instantly share code, notes, and snippets.

@ggreg
Created July 30, 2013 16:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggreg/6114524 to your computer and use it in GitHub Desktop.
Save ggreg/6114524 to your computer and use it in GitHub Desktop.
ec2 + route53 with ansible
- name: provision
local_action: ec2 key_name=greg group="{{default_security_group}}" instance_type="{{instance_type}}" image="{{image_id}}" instance_tags='{{instance_tags | to_json}}' monitoring=yes wait=yes
register: ec2
- name: set_dns_record
route53: >
command=create
zone=botify.com
type=A
value={{item.public_ip}}
with_items: ec2.instances
@ralph-tice
Copy link


---
- name: Setup for DNS in AWS
  hosts: 127.0.0.1
  gather_facts: false
  connection: local
  tasks:
  - name: provision                                                                                         
    ec2: key_name=greg group="{{default_security_group}}" instance_type="{{instance_type}}" image="{{image_id}}" instance_tags='{{instance_tags | to_json}}' monitoring=yes wait=yes
    register: ec2 
  - name: set_dns_record                                                                                    
    route53: >                                                                                              
      command=create
      zone=botify.com                                                                                       
      type=A
      value={{item.public_ip}}
    with_items: ec2.instances

IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment