Guest User

Untitled

a guest
Oct 22nd, 2013
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ---
  2. - hosts:
  3. - local
  4. connection: local
  5. gather_facts: False
  6. vars_files:
  7. - group_vars/{{ dc }}
  8. - group_vars/common.yml
  9.  
  10. tasks:
  11. - name: Launch EC2 web front ends
  12. local_action: ec2
  13. ec2_url={{ ec2_url }}
  14. image={{ image }}
  15. instance_type={{ instance_type }}
  16. keypair={{ keypair }}
  17. wait=true
  18. group={{ web_security_group }}
  19. # instance_tags = {{ instance_tags }}
  20. register: ec2
  21.  
  22. - name: Add new instance to host group
  23. local_action: add_host hostname={{ item.public_dns_name }} groupname=webservers
  24. with_items: ec2.instances
  25.  
  26. - name: Wait for SSH to come up
  27. local_action: wait_for host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state=started
  28. with_items: ec2.instances
  29.  
  30. - name: Configure instance(s)
  31. hosts: webservers
  32. roles:
  33. - common
  34. - webtier
Advertisement
Add Comment
Please, Sign In to add comment