# Variable substitution in meta/main.yml

**URL:** <https://forum.ansible.com/t/variable-substitution-in-meta-main-yml/29193>\
**Category:** Ansible Project\
**Created:** [December 4, 2018, 4:17pm UTC](https://forum.ansible.com/t/variable-substitution-in-meta-main-yml/29193 "2018-12-04T16:17:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Connell](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@Lee\_Connell](https://forum.ansible.com/u/Lee_Connell)\
**Post date:** [December 4, 2018, 4:17pm UTC](https://forum.ansible.com/t/variable-substitution-in-meta-main-yml/29193/1 "2018-12-04T16:17:51Z")

</div>

Hi all,

I am looking to use variable substitution in meta/main.yml and it doesn’t seem to be working, at least on 2.4.2. Is this a supported feature in any of the newer versions? My use case is I have one “common” role that includes many roles that are common to a particular system. This allows us to include a single role to pull in all of these “dependencies”. The issue I’m facing is when any of these dependent roles get updated and tagged within Git - we have to also update the “common” role which just seems cumbersome. Also, some users may want to stick with an older version vs using the newer version. If we could use variables, this could be easily circumvented by providing a tag dynamically for each role.

Any insight would be appreciated. Thanks!

**meta/main.yml**

`

- name: ansible\_adr\_nrpe\_role  
src: “[git@github.com](mailto:git@github.com)/ansible\_adr\_nrpe\_role.git”  
scm: git  
version:“{{ansible\_adr\_nrpe\_role\_version}}”  
`

---

<div class="post-metadata">

**Author:** ![Lee\_Connell](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@Lee\_Connell](https://forum.ansible.com/u/Lee_Connell)\
**Post date:** [April 8, 2019, 11:09am UTC](https://forum.ansible.com/t/variable-substitution-in-meta-main-yml/29193/2 "2019-04-08T11:09:06Z")

</div>

Nobody has any input on this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 9, 2019, 1:32pm UTC](https://forum.ansible.com/t/variable-substitution-in-meta-main-yml/29193/3 "2019-04-09T13:32:55Z")

</div>

There is no templating in meta/main.yml, so no variable substitution.

The only thing that 'works' is defining vars based on a template,  
since they are 'lazily evaluated' later on use inside the dependent  
role.
