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

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

It is in the porting guide at: 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.

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.