# ERROR! Syntax Error while loading YAML.   mapping values are not allowed in this context

**URL:** <https://forum.ansible.com/t/error-syntax-error-while-loading-yaml-mapping-values-are-not-allowed-in-this-context/27894>\
**Category:** Ansible Project\
**Created:** [June 28, 2018, 10:09am UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml-mapping-values-are-not-allowed-in-this-context/27894 "2018-06-28T10:09:58Z")\
**Posts on this page:** 2\
**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 28, 2018, 10:09am UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml-mapping-values-are-not-allowed-in-this-context/27894/1 "2018-06-28T10:09:58Z")

</div>

`

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

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

- nfs-common

- name: Create webservers directory  
file:  
path: /nfs/{{ item.value.folder }}  
state: directory  
with\_dict:

- “{{ webservers }}”

- mount a webserver for each folder  
mount:  
path: /nfs/{{ item.value.folder}}  
src: {{ item.value.mount }}  
fstype: nfs  
state: present  
with\_dict:

- "{{ webservers }}

`

`

- hosts: fileserver  
become: true  
become\_method: sudo

roles:

- mount

vars:  
webservers:  
webserver1:  
folder: webserver1  
mount: ip:/var/www/wordpress  
webserver2:  
folder: webserver2  
mount: ip:/var/www/wordpress

`

The error appears to have been in ‘/home/victors/.ansible/roles/mount/tasks/main.yml’: line 19, column 8, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- mount a webserver for each folder  
mount:  
^ here

---

<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 28, 2018, 2:24pm UTC](https://forum.ansible.com/t/error-syntax-error-while-loading-yaml-mapping-values-are-not-allowed-in-this-context/27894/2 "2018-06-28T14:24:01Z")

</div>

The problem is with the following:

```auto

- mount a webserver for each folder
mount:

```

You are missing a `name: `. You instead want:

```auto

- name: mount a webserver for each folder
mount:

```
