-
Notifications
You must be signed in to change notification settings - Fork 1
/
create.yml
74 lines (68 loc) · 2.03 KB
/
create.yml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: Create basic AWS instance for Radiomics
hosts: local
connection: local
gather_facts: false
vars:
- region: us-east-1
- pub_key_name: radiomics-girder
- ami: ami-76e27e1e
- ec2_instance_type: t2.medium
- girder_eip: 54.174.35.141
tasks:
- name: Create an AWS security group for the instance
ec2_group:
name: "girder_for_dev"
description: security group for covalic webserver machines
region: "{{ region }}"
rules:
# SSH from KHQ
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 66.194.253.20/32
# SSH from KRS
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 97.65.130.169/32
# SSH from KSW
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 23.31.117.189/32
# HTTP from everywhere
- proto: tcp
from_port: 80
to_port: 80
cidr_ip: 0.0.0.0/0
# HTTPS from everywhere
- proto: tcp
from_port: 443
to_port: 443
cidr_ip: 0.0.0.0/0
rules_egress:
# egress to everywhere
- proto: all
from_port: all
to_port: all
cidr_ip: 0.0.0.0/0
- local_action:
module: ec2
key_name: "{{ pub_key_name }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ ami }}"
wait: yes
group: "girder_for_dev"
region: "{{ region }}"
exact_count: 1
count_tag:
Name: girder-radiomics
id: girder-radiomics-devel
instance_tags:
Name: girder-radiomics
type: girder
register: girder_radiomics
- name: associate DNS mapped elastic IP with girder prod webserver
ec2_eip: "instance_id={{ girder_radiomics.tagged_instances[0].id }} region={{ region }} ip={{ girder_eip }}"
register: eip