# Different behavior of path resolving in lookup function in 1.5.3 and 1.5.4

**URL:** <https://forum.ansible.com/t/different-behavior-of-path-resolving-in-lookup-function-in-1-5-3-and-1-5-4/14951>\
**Category:** Ansible Project\
**Created:** [April 7, 2014, 9:25am UTC](https://forum.ansible.com/t/different-behavior-of-path-resolving-in-lookup-function-in-1-5-3-and-1-5-4/14951 "2014-04-07T09:25:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Romanovsky](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Max\_Romanovsky](https://forum.ansible.com/u/Max_Romanovsky)\
**Post date:** [April 7, 2014, 9:25am UTC](https://forum.ansible.com/t/different-behavior-of-path-resolving-in-lookup-function-in-1-5-3-and-1-5-4/14951/1 "2014-04-07T09:25:00Z")

</div>

Hello,

I have a problem after migration from 1.5.3 to 1.5.4

My ansible directory is structured according to recommendations in Best Practices doc.  
It is stored in /vagrant/ansible

/vagrant/ansible/group\_vars/all contains directives like

`fileshare_username: foo fileshare_password: "{{ lookup('file', '../../../credentials/common/ldap/' + fileshare_username) }}"`

Password is stored in /vagrant/ansible/credentials/common/ldap/foo

/vagrant/ansible/roles/app/tasks/main.yml contains task that uses these credentials:

- name: copy smb credentials for the user  
sudo: yes  
sudo\_user: “{{ cli\_user }}”  
template: src=.smbcredentials.j2 dest=~/.smbcredentials mode=0600  
with\_items:
- {username: “{{ fileshare\_username }}”, password: “{{ fileshare\_password }}”}

I execute Ansible from /vagrant/ansible directory.

After upgrade to 1.5.4 I receive the following message:

`/credentials/common/ldap/foo does not exist`

It means that now Ansible resolves this path from the current directory, while earlier it resolved this path from the base directory of /vagrant/ansible/roles/app/tasks/main.yml file.  
If I change fileshare\_password value to “{{ lookup(‘file’, ‘credentials/common/ldap/’ + fileshare\_username) }}” or “{{ lookup(‘file’, ‘./credentials/common/ldap/’ + fileshare\_username) }}” then it starts looking for the /vagrant/ansible/roles/app/files/credentials/common/ldap/foo file. Changing value to “{{ lookup(‘file’, ‘./…/…/…/credentials/common/ldap/’ + fileshare\_username) }}” don’t help (it falls to /credentials).

I’m using self-compiled deb packages for Debian 7 without any modifications (git clone && git checkout v1.5.4 && make deb).

I haven’t posted issue on github because I’m not sure if it’s an issue.

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:** [April 9, 2014, 1:39pm UTC](https://forum.ansible.com/t/different-behavior-of-path-resolving-in-lookup-function-in-1-5-3-and-1-5-4/14951/2 "2014-04-09T13:39:10Z")

</div>

Ansible is now evaluating some things earlier, though it may need to be told to not evaluate lookup plugins at that stage.

Please file a ticket on github with steps to reproduce if you haven’t done so already.

Thanks!

---

<div class="post-metadata">

**Author:** ![Max\_Romanovsky](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Max\_Romanovsky](https://forum.ansible.com/u/Max_Romanovsky)\
**Post date:** [April 22, 2014, 1:16pm UTC](https://forum.ansible.com/t/different-behavior-of-path-resolving-in-lookup-function-in-1-5-3-and-1-5-4/14951/3 "2014-04-22T13:16:01Z")

</div>

Thank you Michael!

I’ll try to create a snippet with a minimal code necessary to reproduce the issue.  
Then I’ll post it to the github.
