aboutsummaryrefslogtreecommitdiffstats
path: root/tests/files/ansible/roles/ec2/tasks/setup.yml
blob: 0876d8d2de6fef8abbe24debf385060b12b40b20 (plain) (blame)
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
---
- 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 }}"
    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: test_runner
    count_tag: 
      Name: test_runner
    exact_count: "{{ total_no_instances }}"
#    volumes:
#      - device_name: /dev/xvda
#        volume_size: "{{ volume_size_gb }}"