Currently, my EC2 game preparation process is as follows:
- name: Provisioning Spot instaces
ec2:
spot_price: 0.50
spot_wait_timeout: 300
assign_public_ip: no
aws_access_key: "{{ aws_id }}"
aws_secret_key: "{{ aws_key }}"
region: "{{ aws_region }}"
image: "{{ image_instance }}"
instance_type: "{{ large_instance }}"
key_name: "{{ ssh_keyname }}"
count: 3
state: present
group_id: "{{ cypher_priv_sg }}"
vpc_subnet_id: "{{ private_subnet_id }}"
wait: true
instance_tags:
Name: Cypher-Worker
register: ec2
So, is it possible to do the following:
During the initialization of the EC2 (spot) instance, I want to check gradually (for example, 40%, 50%, 60%, 70% ..)) And if all else fails, create the instance on request. How to do it?
Can I use the Blocks function here? If so, how?
source
share