blob: f9a57af43b90856a307d60a02715ed57f260a378 [file] [log] [blame]
---
# tasks file for aws-create
- name: Provision AMI instances
ec2:
assign_public_ip: '{{ assign_public_ip }}'
image: "{{ image_id }}"
instance_type: '{{ instance_type }}'
aws_access_key: "{{ aws_access_key | default(lookup('env', 'AWS_ACCESS_KEY_ID')) }}"
aws_secret_key: "{{ aws_secret_key | default(lookup('env', 'AWS_SECRET_ACCESS_KEY')) }}"
aws_region: "{{ aws_region | default(lookup('env', 'AWS_REGION')) }}"
key_name: '{{ key_name }}'
wait: '{{ wait }}'
state: present
group: '{{ security_group }}'
vpc_subnet_id: '{{ vpc_subnet_id }}'
volumes:
- device_name: '{{ device_name }}'
volume_type: '{{ volume_type }}'
volume_size: '{{ volume_size }}'
delete_on_termination: '{{ delete_on_termination }}'
instance_tags:
'Name': '{{ instance_tags_Name }}'
register: status
with_sequence: start={{ start }} end={{ end }}
- name: Provision AMI instances Report
debug:
var: status
- name: Waiting for server to initialize
become: no
local_action:
module: wait_for
host: '{{ inventory_hostname }}'
state: started
delay: "{{ start_check_delay | d(15) }}"
timeout: '{{ server_restart_timeout | d(60) }}'