# Line appending failing

**URL:** <https://forum.ansible.com/t/line-appending-failing/21366>\
**Category:** Ansible Project\
**Created:** [May 5, 2016, 5:29pm UTC](https://forum.ansible.com/t/line-appending-failing/21366 "2016-05-05T17:29:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amritha\_sanath](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@amritha\_sanath](https://forum.ansible.com/u/amritha_sanath)\
**Post date:** [May 5, 2016, 5:29pm UTC](https://forum.ansible.com/t/line-appending-failing/21366/1 "2016-05-05T17:29:49Z")

</div>

I have a file which is datadog.conf in which i have to append the line dogstreams: /root/ddmonitor/pattern.txt:/opt/datadog-agent/agent/checks/libs/parsers.py:parse-web at EOF

i am using ansible lineinfile option and my code looks like below:

````-
lineinfile: dest=/etc/dd-agent/datadog.conf regexp="^dogstreams: " line="dogstreams: /root/ddmonitor/pattern.txt:/opt/datadog-agent/agent/checks/libs/parsers.py:parse-web"```

i am getting below error while running playbook :

ERROR! Syntax Error while loading YAML.

The error appears to have been in '/etc/ansible/roles/datadog-pegalogs-apptier/tasks/main.yml': line 19, column 66, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: copy datadog agent configuration file
lineinfile: dest=/etc/dd-agent/datadog.conf regexp="^dogstreams: " line="dogstreams: /root/ddmonitor/pattern.txt:/opt/datadog-agent/agent/checks/libs/parsers.py:parse_web"
^ here
We could be wrong, but this one looks like it might be an issue with
unbalanced quotes. If starting a value with a quote, make sure the
line ends with the same set of quotes. For instance this arbitrary
example:

foo: "bad" "wolf"

Could be written as:

foo: '"bad" "wolf"'
````

---

<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 6, 2016, 7:52am UTC](https://forum.ansible.com/t/line-appending-failing/21366/2 "2016-05-06T07:52:48Z")

</div>

What happens if you use a different line?

lineinfile: dest=/etc/dd-agent/datadog.conf regexp="^dogstreams: "  
line="foobar"

And, maybe, try using single quotes instead of the double quotes.

Johannes
