# Cron with\_items hash + spaces

**URL:** <https://forum.ansible.com/t/cron-with-items-hash-spaces/14154>\
**Category:** Ansible Project\
**Created:** [December 13, 2013, 7:59pm UTC](https://forum.ansible.com/t/cron-with-items-hash-spaces/14154 "2013-12-13T19:59:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrianAI](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@BrianAI](https://forum.ansible.com/u/BrianAI)\
**Post date:** [December 13, 2013, 7:59pm UTC](https://forum.ansible.com/t/cron-with-items-hash-spaces/14154/1 "2013-12-13T19:59:47Z")

</div>

Another question folks.

When I try the following bit of code, it seems to choke:

> **10 - name: set cron for any cron-able scripts**  
> **11 cron: name={{ item.name }} job={{ item.job }} state=present**  
> **12 with\_items:**  
> **13 - { name: Gather stuff, job: do stuff }**  
> **14 - { name: “Check Response Codes”, job: “sleep 5; /etc/server1/scripts/check\_files \> /tmp/check\_files\_results” }**

However, if I do the following, it works:

> **10 - name: set cron for any cron-able scripts**  
> **11 cron: name={{ item.name }} job={{ item.job }} state=present**  
> **12 with\_items:**  
> **13 - { name: Gather, job: do }**  
> **14 - { name: “Check”, job: “sleep” }**

Basically, it seems the spaces are throwing things off. I’ve tried with single quotes, double quotes, etc. etc.  
Below, is the error:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [December 13, 2013, 11:00pm UTC](https://forum.ansible.com/t/cron-with-items-hash-spaces/14154/2 "2013-12-13T23:00:46Z")

</div>

param=“{{ var }}”

– Michael

---

<div class="post-metadata">

**Author:** ![BrianAI](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@BrianAI](https://forum.ansible.com/u/BrianAI)\
**Post date:** [December 14, 2013, 3:21am UTC](https://forum.ansible.com/t/cron-with-items-hash-spaces/14154/3 "2013-12-14T03:21:24Z")

</div>

a lot closer! i should have thought of / realized that. Looks like something is still not happy:

---

<div class="post-metadata">

**Author:** ![BrianAI](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@BrianAI](https://forum.ansible.com/u/BrianAI)\
**Post date:** [December 14, 2013, 4:12am UTC](https://forum.ansible.com/t/cron-with-items-hash-spaces/14154/4 "2013-12-14T04:12:30Z")

</div>

so it seems the space after name= " was the problem.

The reason I put that space there is because the syntax highlighting in VIM completely got thrown off by having name=“…but either way (even with the bad syntax highlighting), it still works properly now that i have name=”

Thanks!!! 🙂
