# Group vars lookup pipe

**URL:** <https://forum.ansible.com/t/group-vars-lookup-pipe/21541>\
**Category:** Ansible Project\
**Created:** [May 24, 2016, 2:12pm UTC](https://forum.ansible.com/t/group-vars-lookup-pipe/21541 "2016-05-24T14:12:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meher\_Garda](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Meher\_Garda](https://forum.ansible.com/u/Meher_Garda)\
**Post date:** [May 24, 2016, 2:12pm UTC](https://forum.ansible.com/t/group-vars-lookup-pipe/21541/1 "2016-05-24T14:12:43Z")

</div>

In my group\_vars folder , I have a file which has the following

scheduletime: 2016-09-01 08:41:15

stime: “{{lookup(‘pipe’,‘date +%Y-%m-%dT%H:%M:%SZ -d ‘+{{ scheduletime }}+’’)}}”

I want to provide human readable time via scheduletime and then convert it into iso 8601 format

the following works on linux: date +%Y-%m-%dT%H:%M:%SZ -d “2016-09-01 08:41:15”

tryin to represent the same in ansible group\_vars.

fatal: [localhost] =\> Failed to template {{stime}}: Failed to template {{lookup(‘pipe’,‘date +%Y-%m-%dT%H:%M:%SZ -d ‘+{{ scheduletime }}+’’)}}: template error while templating string: expected token ‘:’, got ‘}’

I have tried many combinations of quotes, double quotes, but cannot seem to get it to work.

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 25, 2016, 1:42pm UTC](https://forum.ansible.com/t/group-vars-lookup-pipe/21541/2 "2016-05-25T13:42:41Z")

</div>

Try escaping the single quotes and the colons.

Maybe run the task without using the variable, and just put a sample  
value after the ...-d '+... Maybe you might need to quote that value  
or escape it somehow. Finding out is easier without using a variable.

Johannes
