Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts:
- - local
- connection: local
- gather_facts: False
- vars_files:
- - group_vars/{{ dc }}
- - group_vars/common.yml
- tasks:
- - name: Launch EC2 web front ends
- local_action: ec2
- ec2_url={{ ec2_url }}
- image={{ image }}
- instance_type={{ instance_type }}
- keypair={{ keypair }}
- wait=true
- group={{ web_security_group }}
- # instance_tags = {{ instance_tags }}
- register: ec2
- - name: Add new instance to host group
- local_action: add_host hostname={{ item.public_dns_name }} groupname=webservers
- with_items: ec2.instances
- - name: Wait for SSH to come up
- local_action: wait_for host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state=started
- with_items: ec2.instances
- - name: Configure instance(s)
- hosts: webservers
- roles:
- - common
- - webtier
Advertisement
Add Comment
Please, Sign In to add comment