# ERROR! Syntax Error while loading YAML.

**URL:** <https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864>\
**Category:** Ansible Project\
**Created:** [June 25, 2018, 3:34pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864 "2018-06-25T15:34:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VS1](https://avatars.discourse-cdn.com/v4/letter/v/bbe5ce/32.png) [@VS1](https://forum.ansible.com/u/VS1)\
**Post date:** [June 25, 2018, 3:34pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864/1 "2018-06-25T15:34:05Z")

</div>

Hi Guys, I get the following error while running an ansible-playbook

> ERROR! Syntax Error while loading YAML.  
> mapping values are not allowed in this context  
> The error appears to have been in ‘/home/user/.ansible/roles/nfs/tasks/main.yml’: line 14, column 16, but may  
> be elsewhere in the file depending on the exact syntax problem.  
> The offending line appears to be:  
> dest:/etc/exports  
> insertafter: EOF  
> ^ here

This is the role i have created

`

- name: Update apt cahce  
apt: update\_cache=yes cache\_valid\_time=3600

- name: Install NFS Kernel on websevers  
apt: name={{ item }} state=present  
with\_items:

- nfs-kernel-server

- name: Update Exports file nfs  
lineinfile:  
dest:/etc/exports  
insertafter: EOF  
create: True  
line: /var/www/wordpress \*(insecure,rw,all\_squash,anonuid=1000,anongid=1000,no\_subtree\_check)  
notify:

- restart nfs

`  
What i am doing wrong ?

---

<div class="post-metadata">

**Author:** ![VS1](https://avatars.discourse-cdn.com/v4/letter/v/bbe5ce/32.png) [@VS1](https://forum.ansible.com/u/VS1)\
**Post date:** [June 25, 2018, 3:35pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864/2 "2018-06-25T15:35:50Z")

</div>

[![](https://lh3.googleusercontent.com/-rw3Zz0ShKPQ/WzELyRFXOGI/AAAAAAAApko/7P6uuuwH2nwsEGrEH_xtHBkEWxw_34YQACLcBGAs/s320/2018-06-25_17h35_08.png)](https://lh3.googleusercontent.com/-rw3Zz0ShKPQ/WzELyRFXOGI/AAAAAAAApko/7P6uuuwH2nwsEGrEH_xtHBkEWxw_34YQACLcBGAs/s1600/2018-06-25_17h35_08.png)

luni, 25 iunie 2018, 18:34:05 UTC+3, Victor Sava a scris:

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 25, 2018, 3:37pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864/3 "2018-06-25T15:37:20Z")

</div>

Your issue is with `dest:/etc/exports`. There needs to be a space after the `:`, so it should instead look like:

`dest: /etc/exports`

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [June 25, 2018, 3:38pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864/4 "2018-06-25T15:38:15Z")

</div>

It looks like there is no space after the colon after “dest”…

Regards, K.

---

<div class="post-metadata">

**Author:** ![Izzy](https://avatars.discourse-cdn.com/v4/letter/i/c2a13f/32.png) [@Izzy](https://forum.ansible.com/u/Izzy)\
**Post date:** [June 25, 2018, 3:38pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml/27864/5 "2018-06-25T15:38:32Z")

</div>

Beat me to it Matt lol
