# vars\_files not importing existing file

**URL:** <https://forum.ansible.com/t/vars-files-not-importing-existing-file/15534>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 24, 2014, 4:21pm UTC](https://forum.ansible.com/t/vars-files-not-importing-existing-file/15534 "2014-06-24T16:21:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![micafer](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@micafer](https://forum.ansible.com/u/micafer)\
**Post date:** [June 24, 2014, 4:21pm UTC](https://forum.ansible.com/t/vars-files-not-importing-existing-file/15534/1 "2014-06-24T16:21:32Z")

</div>

Hi,

I create an issue in the ansible github and Michael DeHaan recomend me to ask here for help.

All the information is in this issue:  
[https://github.com/ansible/ansible/issues/7901](https://github.com/ansible/ansible/issues/7901)

The summary is:

In Ubuntu 12.04. versions 1.5.4, 1.5.5, 1.6.0 and 1.6.1, a “vars\_files” section defined like the following example do not find the file to include (in the example Ubuntu.yml). But the os\_defaults.yml file is imported correctly.  
The same example used with versions older or equal than 1.5.3 and versions 1.6.2 and 1.6.3 works correctly.

```auto
---
- hosts: all
  vars_files:
  - - {{ ansible_distribution }}.yml
    - os_defaults.yml

  tasks:
  - debug: msg="{{some_var}}"

```

This is the message of the “incorrect” versions:

```auto
158.42.105.25: not importing file: /home/ubuntu/{{ansible_distribution}}.yml

```

This is the message of the “correct” versions:

```auto
158.42.105.25: importing /home/ubuntu/Ubuntu.yml

```

Any ideas?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 24, 2014, 7:38pm UTC](https://forum.ansible.com/t/vars-files-not-importing-existing-file/15534/2 "2014-06-24T19:38:58Z")

</div>

" - - {{ ansible\_distribution }}.yml

```auto
    - os_defaults.yml"

```

```auto

```

```auto
This looks like a formatting error to me.

```

```auto

```

```auto
vars_files:

```

```auto
   - ["{{ ansible_os_distribution }}.yml", "os_defaults.yml"]

```

```auto

```

```auto
OR:

```

---

<div class="post-metadata">

**Author:** ![micafer](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@micafer](https://forum.ansible.com/u/micafer)\
**Post date:** [June 25, 2014, 7:24am UTC](https://forum.ansible.com/t/vars-files-not-importing-existing-file/15534/3 "2014-06-25T07:24:48Z")

</div>

Hi,

The format I show in the example is the output obtained by the dump function of the PyYAML library, so I suppose that is a correct YAML format.  
Anyway I tested with these formats and all of them get the same result.  
With versions 1.5.4, 1.5.5, 1.6.0 and 1.6.1 it does not work and with versions older or equal than 1.5.3 and versions 1.6.2 and 1.6.3 it works correctly.

Best regards.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 26, 2014, 12:09am UTC](https://forum.ansible.com/t/vars-files-not-importing-existing-file/15534/4 "2014-06-26T00:09:07Z")

</div>

I’ve never seen that variation before, interesting.

Ok, we’ll reopen this and verify that we do have an integration test for conditional vars\_files.
