ERROR! Syntax Error while loading YAML.

425 views
Skip to first unread message

Victor Sava

unread,
Jun 25, 2018, 11:34:05 AM6/25/18
to Ansible Project
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 ?

Victor Sava

unread,
Jun 25, 2018, 11:35:50 AM6/25/18
to Ansible Project

Matt Martz

unread,
Jun 25, 2018, 11:38:06 AM6/25/18
to ansible...@googlegroups.com
Your issue is with `dest:/etc/exports`.  There needs to be a space after the `:`, so it should instead look like:

`dest: /etc/exports`

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b355de24-9c8f-4aa4-bfa2-6753bfbc43ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Karl Auer

unread,
Jun 25, 2018, 11:38:23 AM6/25/18
to ansible...@googlegroups.com
It looks like there is no space after the colon after "dest"...

Regards, K.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/66df5f95-751e-4dda-a57c-7b01b0b42fbf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Karl Auer

Email  : ka...@2pisoftware.com
Website: 
http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

Izzy Martinez

unread,
Jun 25, 2018, 11:38:40 AM6/25/18
to ansible...@googlegroups.com
Beat me to it Matt lol

Sent from my iPad
Reply all
Reply to author
Forward
0 new messages