# cannot substitute the key path with variable inside the lookup module

**URL:** <https://forum.ansible.com/t/cannot-substitute-the-key-path-with-variable-inside-the-lookup-module/17747>\
**Category:** Ansible Project\
**Created:** [March 15, 2015, 8:01pm UTC](https://forum.ansible.com/t/cannot-substitute-the-key-path-with-variable-inside-the-lookup-module/17747 "2015-03-15T20:01:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_Boobyer](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@George\_Boobyer](https://forum.ansible.com/u/George_Boobyer)\
**Post date:** [March 15, 2015, 8:01pm UTC](https://forum.ansible.com/t/cannot-substitute-the-key-path-with-variable-inside-the-lookup-module/17747/1 "2015-03-15T20:01:30Z")

</div>

I don't think you need the string concatenation - in Brian's example he is building a string - you are just using a variable alone?

Have you tried  
key\_material: "{{ lookup('file', ssh\_key\_location) }}"

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 16, 2015, 5:32pm UTC](https://forum.ansible.com/t/cannot-substitute-the-key-path-with-variable-inside-the-lookup-module/17747/2 "2015-03-16T17:32:19Z")

</div>

Hi George, Yes I did that and it’s work for me, Thanks
