forked from thisdavejohnson/sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-shellshock-launch.yml
43 lines (39 loc) · 1.38 KB
/
demo-shellshock-launch.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
---
# Provision instances for the Shellshock demo:
- hosts: localhost
connection: local
gather_facts: False
vars_files:
- group_vars/all
# Tag the instances with the username of the Tower user
tasks:
- name: Launch shellshock instances
ec2: >
access_key="{{ ec2_access_key }}"
secret_key="{{ ec2_secret_key }}"
keypair="{{ ec2_keypair }}"
group="{{ ec2_security_group }}"
type="{{ ec2_instance_type }}"
image="ami-6c1e8f04"
region="{{ ec2_region }}"
instance_tags="{'ansible_group':'shellshock', 'type':'{{ ec2_instance_type }}', 'group':'{{ ec2_security_group }}', 'Name':'demo_''{{ tower_user_name }}'}"
count="{{ ec2_instance_count }}"
wait=true
register: ec2
- name: Launch non-vulnerable instances
ec2: >
access_key="{{ ec2_access_key }}"
secret_key="{{ ec2_secret_key }}"
keypair="{{ ec2_keypair }}"
group="{{ ec2_security_group }}"
type="{{ ec2_instance_type }}"
image="{{ ec2_image }}"
region="{{ ec2_region }}"
instance_tags="{'ansible_group':'shellshock', 'type':'{{ ec2_instance_type }}', 'group':'{{ ec2_security_group }}', 'Name':'demo_''{{ tower_user_name }}'}"
count="1"
wait=true
register: ec2
- name: Wait for SSH to come up
local_action: wait_for host={{ item.public_dns_name }}
port=22 delay=60 timeout=320 state=started
with_items: ec2.instances