# Credstash Plugin Lookup Failure with Variable

**URL:** <https://forum.ansible.com/t/credstash-plugin-lookup-failure-with-variable/23758>\
**Category:** Ansible Project\
**Created:** [February 17, 2017, 3:08pm UTC](https://forum.ansible.com/t/credstash-plugin-lookup-failure-with-variable/23758 "2017-02-17T15:08:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foster\_Rilindo](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@Foster\_Rilindo](https://forum.ansible.com/u/Foster_Rilindo)\
**Post date:** [February 17, 2017, 3:08pm UTC](https://forum.ansible.com/t/credstash-plugin-lookup-failure-with-variable/23758/1 "2017-02-17T15:08:21Z")

</div>

I am trying to lookup a secret through Ansible’s credstash plugin by first setting the variable of the table (since I have multiple credstash tables) and then looking it up - , something like this:

`  
credstash\_table: “foo\_credstash\_{{ bar }}”"  
password: “{{ lookup(‘credstash’, ‘password’, table={{ credstash\_table }} ) }}”

`

> |
> 
> - |
> 
> >

Somehow, it doesn’t seem to like this:

`  
fatal: [localhost]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “AnsibleError: {{ lookup(‘credstash’, ‘password’, table={{ credstashtable }} ) }}: template error while templating string: expected token ‘:’, got ‘}’. String: {{ lookup(‘credstash’, ‘password’, table={{ credstashtable }} ) }}”}

`

```auto

I tried this approach:

```

```auto

```

`  
credstash\_table: “foo\_credstash\_{{ bar }}”"  
password: “{{ lookup(‘credstash’, ‘password’, table=‘{{ credstash\_table }}’ ) }}”

`
