First working version.
This commit is contained in:
parent
8bc7a20125
commit
66636433eb
11 changed files with 222 additions and 2 deletions
28
aws/roles/ec2_create/tasks/main.yml
Normal file
28
aws/roles/ec2_create/tasks/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
- name: Create hashcat instance
|
||||
ec2:
|
||||
region: "{{ ec2.region }}"
|
||||
keypair: "{{ ec2.credentials }}"
|
||||
instance_tags: "{{ ec2.tags }}"
|
||||
image: "{{ ec2.image }}"
|
||||
instance_type: "{{ ec2.instance_type }}"
|
||||
instance_profile_name: "{{ ec2.role | default('') }}"
|
||||
instance_initiated_shutdown_behavior: "{{ ec2.shutdownbehavior }}"
|
||||
volumes: "{{ ec2.volumes }}"
|
||||
group: "{{ ec2.sg }}"
|
||||
vpc_subnet_id: "{{ ec2.subnet }}"
|
||||
assign_public_ip: "{{ ec2.public_ip | default('no') }}"
|
||||
private_ip: "{{ ec2.private_ip | default('') }}"
|
||||
wait: true
|
||||
register: myec2
|
||||
|
||||
- name: Add new instance to host group
|
||||
add_host: hostname={{ item.public_ip }} groupname=hashcat
|
||||
with_items: '{{myec2.instances}}'
|
||||
|
||||
- name: Wait for SSH to come up
|
||||
wait_for:
|
||||
host: "{{ item.public_ip }}"
|
||||
port: 22
|
||||
state: started
|
||||
#delay: 500
|
||||
with_items: '{{ myec2.instances }}'
|
Loading…
Add table
Add a link
Reference in a new issue