# templating a variable name in ansible 2.9 is not working as before, did I miss something in the release notes ?

**URL:** <https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856>\
**Category:** Ansible Project\
**Created:** [December 20, 2019, 3:00pm UTC](https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856 "2019-12-20T15:00:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahespth](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mahespth/32/252_2.png) [@mahespth](https://forum.ansible.com/u/mahespth)\
**Post date:** [December 20, 2019, 3:00pm UTC](https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856/1 "2019-12-20T15:00:08Z")

</div>

Hi,

We have some plays that work ok in ansible \<2.9, they are used to generate various repositories based on facts and they do not appear to work any longer after ansible 2.9 update - I have rolled back just the ansible package and its working again.

I’ve read the release notes and I’m can’t see any thing specific regarding this change. Has anyone else seen the same behaviour?

Cheers.

vars.yml

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [December 20, 2019, 3:30pm UTC](https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856/2 "2019-12-20T15:30:07Z")

</div>

It is in the porting guide at: [https://docs.ansible.com/ansible/latest/porting\_guides/porting\_guide\_2.9.html#loops](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.9.html#loops)

However, that entry specifically targeted info about loops. But the change can affect more uses of templating.

Where is `include_this_please` coming from? Is it a single vault encrypted value?

Effectively, we improved the “unsafe” variable system, and single vaulted values are unsafe, and should never be allowed to be templated. So when they are involved in templating data, it prevents templating from happening.

---

<div class="post-metadata">

**Author:** ![mahespth](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mahespth/32/252_2.png) [@mahespth](https://forum.ansible.com/u/mahespth)\
**Post date:** [December 20, 2019, 3:56pm UTC](https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856/3 "2019-12-20T15:56:36Z")

</div>

Thanks Matt, I did read that but didn’t see how it would effect my code. The vars are include\_vars (yaml) and interspersed with facts such as ansible\_distribution\_major\_version.

example:

managed\_yum\_repos:

“rhel-{{ ansible\_distribution\_major\_version }}-server-rpms”:

description: “Red Hat Enterprise Linux {{ ansible\_distribution\_major\_version }} Server (RPMs)”

baseurl: …

I have a workaround to use {{ lookup(‘flattened’,[my\_packed\_variable]) }}, this lets me run with the identical vars on both versions for now.
