# Do a variable defined in vars/main.yml will be evaluated in defaults/main.yml?

**URL:** <https://forum.ansible.com/t/do-a-variable-defined-in-vars-main-yml-will-be-evaluated-in-defaults-main-yml/31072>\
**Category:** Ansible Project\
**Created:** [August 19, 2019, 3:18pm UTC](https://forum.ansible.com/t/do-a-variable-defined-in-vars-main-yml-will-be-evaluated-in-defaults-main-yml/31072 "2019-08-19T15:18:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omkar](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@Omkar](https://forum.ansible.com/u/Omkar)\
**Post date:** [August 19, 2019, 3:18pm UTC](https://forum.ansible.com/t/do-a-variable-defined-in-vars-main-yml-will-be-evaluated-in-defaults-main-yml/31072/1 "2019-08-19T15:18:14Z")

</div>

Hello,

I have a question, I want 2 use a URL that has to be dynamically generated. I will be providing the version as a variable to the URL. So here’s what I am doing.

1. I have the url variable defined in defaults/main.yml like this  
url: [https://some.app.here/version-](https://some.app.here/version-){{ version\_no }}.tar.gz

2. I have the variable version\_no defined in the vars/main.yml file as below.  
version\_no:1.2.3

So now my question is, will this work? Will the value of url variable will be [https://some.app.here/version-1.2.3.tar.gz](https://some.app.here/version-1.2.3.tar.gz) after evaluation?

Please let me know if this is possible? If not, please suggest me some solution to achieve the same.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 19, 2019, 3:23pm UTC](https://forum.ansible.com/t/do-a-variable-defined-in-vars-main-yml-will-be-evaluated-in-defaults-main-yml/31072/2 "2019-08-19T15:23:59Z")

</div>

Yes
