Documentation update needed: vars_files no longer expands 'facts' variables in paths since 1.5.4

Hi,

The 1.5.4 change to stop expanding ‘facts’ variables in ‘vars_files’ paths has just hit me (I know I’m behind, running of Scientific Linux 6 so updates are slow!).

I’d just like to point out that the web documentation needs to be updated: specifically the ‘vars_files’ example in the ‘Conditional Imports’ section still uses “{{ansible_os_family}}” in the path:

http://docs.ansible.com/playbooks_variables.html#conditional-imports

I’d like to also ask for some advice on how to update my playbooks now to deal with the new behaviour.

I know there’s a note saying that the feature isn’t used that often, and points you to the ‘group_by’ module, but to be honest the examples on the group_by page make no sense to me (http://docs.ansible.com/group_by_module.html).

This is what I have (and worked prior to 1.5.4):

vars_files:

  • …/vars/global.yml
  • …/vars/{{ansible_distribution}}.yml

(and so I have a ‘vars/Ubuntu.yml’ and ‘vars/Scientific.yml’ etc where I put a couple of OS-specific vars).

I guess I’ll need to reorganise things and maybe use {{ansible_distrubution}} more, but if anyone has an example of how they migrated, I’d appreciate it.

Thanks,
Paddy

No update is ever needed for a bug - we fix the bug.

In this case, this should already be addressed by 1.6.

The current released version of Ansible is 1.6.1, and since you are using Scientific Linux, I highly recommend using EPEL to get the latest Ansible - it’s good stuff.

Hi Michael,

No update is ever needed for a bug - we fix the bug.

In this case, this should already be addressed by 1.6.

Ah ok, so the behaviour has been reverted in 1.6, and facts variables now work again in vars_files paths? I looked through the commit logs but I couldn’t see any mention of the revert.

The current released version of Ansible is 1.6.1, and since you are using Scientific Linux, I highly recommend using EPEL to get the latest Ansible - it’s good stuff.

Yeah, I am grabbing from EPEL – they’re still only on 1.5.5.

Thanks,
Paddy

“I looked through the commit logs but I couldn’t see any mention of the revert.”

Shouldn’t assume it was a revert.