# spot instance block duration  not working in ansible

**URL:** <https://forum.ansible.com/t/spot-instance-block-duration-not-working-in-ansible/24709>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 13, 2017, 11:46am UTC](https://forum.ansible.com/t/spot-instance-block-duration-not-working-in-ansible/24709 "2017-06-13T11:46:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nilesh\_Devare](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@Nilesh\_Devare](https://forum.ansible.com/u/Nilesh_Devare)\
**Post date:** [June 13, 2017, 11:46am UTC](https://forum.ansible.com/t/spot-instance-block-duration-not-working-in-ansible/24709/1 "2017-06-13T11:46:24Z")

</div>

Hi

unable to create aws spot instance with new feature spot block duration we tried to use wait: true but its not working any help please find below yml

- hosts: localhost  
connection: local  
gather\_facts: false

tasks:

- name: launch spot instance  
ec2:  
spot\_price: 0.052  
region: us-east-1  
keypair: test  
group\_id: sg-5789654  
instance\_type: c3.large  
instance\_tags:  
Name: common  
Env: Test  
Owner: mi  
Role: don  
Stack: tem  
Client: test  
count: 1  
image: ami-216a898547  
wait: true  
wait\_timeout: 60  
vpc\_subnet\_id: subnet-64cf8908  
assign\_public\_ip: no  
register: newinstance

- name: allocate and associate a new elastic IP inside a VPC  
ec2\_eip:  
region: us-east-1  
in\_vpc: yes  
instance\_id: “{{ newinstance.instance\_ids[0] }}”  
register: instance\_eip

- debug: var=instance\_eip.public\_ip

Thanks  
Nilesh Devare
