# We could be wrong, but this one looks like it might be an issue with missing quotes.

**URL:** <https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024>\
**Category:** Ansible Project\
**Created:** [April 15, 2014, 9:37pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024 "2014-04-15T21:37:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Holway](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew\_Holway](https://forum.ansible.com/u/Andrew_Holway)\
**Post date:** [April 15, 2014, 9:37pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/1 "2014-04-15T21:37:10Z")

</div>

Hi,

I cant get past this error. I’ve tried various combinations of quotes but to no avail.

Any ideas?

ta,

Andrew

[root@ansible ansible-catn-freeipa]# ansible-playbook freeipa.yml -i hosts  
ERROR: Syntax Error while loading YAML script, /root/ansible-catn-freeipa/roles/replica/tasks/free-ipa-setup.yml  
Note: The error may actually appear before this position: line 36, column 9

name: Pull file from ansible server

- copy: “src=/tmp/{{ freeipaserver\_ip }}/var/lib/ipa/replica-info-{{ ansible\_hostname }}.gpg dest=/var/lib/ipa/replica-info-{{ ansible\_hostname }}.gpg owner=foo group=foo mode=0644”  
^  
We could be wrong, but this one looks like it might be an issue with  
missing quotes. Always quote template expression brackets when they  
start a value. For instance:

with\_items:

- {{ foo }}

Should be written as:

with\_items:

- “{{ foo }}”

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [April 15, 2014, 9:59pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/2 "2014-04-15T21:59:17Z")

</div>

If foo is a list, then do this …

with\_items: foo

---

<div class="post-metadata">

**Author:** ![Andrew\_Holway](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew\_Holway](https://forum.ansible.com/u/Andrew_Holway)\
**Post date:** [April 15, 2014, 10:03pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/3 "2014-04-15T22:03:21Z")

</div>

Hi, please ignore the foo stuff. This spat out with the error.

&nbsp;&nbsp;- copy: "src=/tmp/{{ freeipaserver\_ip }}/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg dest=/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg owner=foo group=foo mode=0644"

This is causing the error.

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [April 15, 2014, 10:04pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/4 "2014-04-15T22:04:28Z")

</div>

Also the hypen should be in front of name: and copy: should be aligned with name:

- name: blah  
copy:

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [April 15, 2014, 10:05pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/5 "2014-04-15T22:05:45Z")

</div>

Also, you don’t need to quote the entire argset:

copy: src=/tmp/“{{ freeipaserver\_ip }}”/var/lib/ipa/replica-info-“{{ ansible\_hostname }}”.gpg dest=/var/lib/ipa/replica-  
info-“{{ ansible\_hostname }}”.gpg owner=foo group=foo mode=0644

---

<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 15, 2014, 10:34pm UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/6 "2014-04-15T22:34:10Z")

</div>

Definitely don’t quote individuals like this, you’ll end up with quotes in the paths!

copy: src=/tmp/“{{ freeipaserver\_ip }}”/var/lib/ipa/replica-info-“{{ ansible\_hostname }}”.gpg dest=/var/lib/ipa/replica-  
info-“{{ ansible\_hostname }}”.gpg owner=foo group=foo mode=0644

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [April 16, 2014, 12:38am UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/7 "2014-04-16T00:38:17Z")

</div>

have you tried?

with\_items:

- foo  
​

---

<div class="post-metadata">

**Author:** ![Andrew\_Holway](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew\_Holway](https://forum.ansible.com/u/Andrew_Holway)\
**Post date:** [April 16, 2014, 7:16am UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/8 "2014-04-16T07:16:20Z")

</div>

As I said. I have tried many combinations of quotes (including no  
quotes) to make this work. It currently looks like this:

name: Pull file from ansible server  
- copy: "src=/tmp/{{ freeipaserver\_ip }}/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg dest=/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg owner=foo group=foo mode=0644"

But I am still getting this error.

ERROR: Syntax Error while loading YAML script,  
/root/ansible-catn-freeipa/roles/replica/tasks/free-ipa-setup.yml  
Note: The error may actually appear before this position: line 36, column 1

name: Pull file from ansible server  
- copy: "src=/tmp/{{ freeipaserver\_ip }}/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg dest=/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg owner=foo group=foo mode=0644"  
^  
We could be wrong, but this one looks like it might be an issue with  
missing quotes. Always quote template expression brackets when they  
start a value. For instance:

---

<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 17, 2014, 2:16am UTC](https://forum.ansible.com/t/we-could-be-wrong-but-this-one-looks-like-it-might-be-an-issue-with-missing-quotes/15024/9 "2014-04-17T02:16:47Z")

</div>

This may be your email wrapping things, but this looks bad to me.

Can you share what you have on [gist.github.com](http://gist.github.com) so we can see instead?

Instead of this:

- copy: “src=/tmp/{{ freeipaserver\_ip }}/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg dest=/var/lib/ipa/replica-info-{{  
ansible\_hostname }}.gpg owner=foo group=foo mode=0644”

I would do this:

- copy:  
src: /tmp/{{ freeipaserver\_ip }}/var/lib/ipa/replica-info-{{ansible\_hostname }}.gpg  
dest: /var/lib/ipa/replica-info-{{ ansible\_hostname }}.gpg owner=foo group=foo  
mode: “0644”

You could also use equal signs instead of the colons.

Just wondering if the indents are actually what’s freaking out the parser, but I’d need to see unformatted by your email program.
