# Error when using vars\_files and vars\_prompt in same playbook

**URL:** <https://forum.ansible.com/t/error-when-using-vars-files-and-vars-prompt-in-same-playbook/12274>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [January 31, 2013, 7:22pm UTC](https://forum.ansible.com/t/error-when-using-vars-files-and-vars-prompt-in-same-playbook/12274 "2013-01-31T19:22:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 31, 2013, 7:22pm UTC](https://forum.ansible.com/t/error-when-using-vars-files-and-vars-prompt-in-same-playbook/12274/1 "2013-01-31T19:22:45Z")

</div>

> Hello,
> 
> I'm new to Ansible and I'm not sure if this is a bug or if I'm doing  
> something wrong. I currently have a playbook which has vars\_prompt and  
> vars\_files in it and no matter what I do, I get a Python error. Here is  
> the playbook:

Ok, this is the classic computer error of an error being raised while  
it is trying to tell you what the actual error really was.

It looks like you want to do

&nbsp;&nbsp;&nbsp;- name:

as opposed to

&nbsp;&nbsp;&nbsp;- (newline)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name:

at least at first glance.

We should definitely intercept the error condition such that we don't  
give you a traceback in that case, so that itself is a bug. Can you  
file one and make sure the playbook you used to reproduce it is in the  
ticket?

Otherwise, fixing the format error should make the error (and the  
traceback) disappear. Using vars\_files/vars\_prompt together is  
definitely legal.

Hope that helps!

--Michael
