43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
---
|
|
- name: create default security group
|
|
ec2_group:
|
|
name: "{{ security_group }}"
|
|
region: "{{ region }}"
|
|
description: "{{ project_description }}"
|
|
rules:
|
|
# ssh
|
|
- proto: tcp
|
|
from_port: 22
|
|
to_port: 22
|
|
cidr_ip: "{{ ip_access_range }}"
|
|
# ethereum incoming connection port
|
|
- proto: tcp
|
|
from_port: 30303
|
|
to_port: 30303
|
|
cidr_ip: "{{ ip_access_range }}"
|
|
# ethereum JSON-RPC server
|
|
- proto: tcp
|
|
from_port: 8080
|
|
to_port: 8080
|
|
cidr_ip: "{{ ip_access_range }}"
|
|
rules_egress:
|
|
- proto: all
|
|
cidr_ip: "{{ ip_access_range }}"
|
|
|
|
|
|
- name: start ec2 instances
|
|
ec2:
|
|
group: "{{ security_group }}"
|
|
instance_type: "{{ instance_type }}"
|
|
image: "{{ image }}"
|
|
wait: true
|
|
region: "{{ region }}"
|
|
key_name: "{{ keypair }}"
|
|
instance_tags:
|
|
Name: "{{ item }}"
|
|
Role: query_test_node
|
|
count_tag: # exactly one instace with the given name
|
|
Name: "{{ item }}"
|
|
exact_count: 1
|
|
with_sequence: start=1 end={{ total_no_instances }} format=test-%02x
|