Currently, my spot EC2 provisioning play looks like this:

- 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 #delete_on_termination: yes register: ec2

So, is it possible to do the following:

While provisioning a (spot)EC2 instance, I want to check incrementally (like (40%. 50%, 60%, 70% .. )) And if all fails, then create an on-demand instance. How do I do this?

Can I make use of the Blocks feature here? If yes, then how?