-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws-provision.yml
More file actions
33 lines (30 loc) · 1.02 KB
/
Copy pathaws-provision.yml
File metadata and controls
33 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
#Demo setup by ansible docs: http://answersforaws.com/code/netflixoss/asgard/
- hosts: localhost
connection: local
gather_facts: False
tasks:
- name: Provision a set of instances
ec2:
group: [SSH,Web]
keypair: KeyPair1
instance_type: t2.micro
region: us-east-1
image: ami-c2a818aa #Centos 6 ; #ami-96a818fe #CentOS7; #ami-a8d369c0 RHEL7. ami-146e2a7c is AmazonLinuxAMI
wait: true
exact_count: 2
count_tag:
Name: WCL Docker Host
instance_tags:
Name: WCL Docker Host
volumes:
- device_name: /dev/sda1
volume_size: 10
delete_on_termination: true
register: ec2
- name: Add all instance public IPs to host group
add_host: hostname={{ item.public_ip }} groupname=ec2
with_items: ec2.instances
- name: Wait for SSH to be available
wait_for: host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state=started
with_items: ec2.instances