I think you just need to line up your whitespace correctly. Indentation 
level is significant in YAML - have a look at the yaml primer 
http://docs.ansible.com/YAMLSyntax.htmlor use yamlint if you need to check 
your playbook.

Hope this helps.

Jon

On Monday, June 22, 2015 at 12:46:58 PM UTC+1, Julien Deloubes wrote:
>
> Hello,
> just learning Ansible with Vagrant and the help of the book "Ansible up 
> and running".
>
> I cannot execute the first playbook  in the book i always had a syntax 
> error.
> Ansible version: 1.9.1
>
> Playbook :
>
> - name: Configure webserver with nginx
> hosts: webservers
> sudo: True
> tasks:
> - name: install nginx
> apt: name=nginx update_cache=yes
> - name: copy nginx config file
> copy: src=files/nginx.conf dest=/etc/nginx/sites-available/default
> - name: enable configuration
> file: >
> dest=/etc/nginx/sites-enabled/default
> src=/etc/nginx/sites-available/default
> state=link
> - name: copy index.html
> template: src=templates/index.html.j2 dest=/usr/share/nginx/html/index.html
> mode=0644
> - name: restart nginx
> service: name=nginx state=restarted
>
> Error:
> ERROR: Syntax Error while loading YAML script, web-notls.yml
> Note: The error may actually appear before this position: line 3, column 2
>
> - name: Configure webserver with nginx
>  hosts: webservers
>  ^
>
> I couldn't find where the syntax is faulty here, do you have any clues?
>
> Thanks.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f371a2aa-76fc-4265-bacd-934229f4d917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to