# YAML syntax error (beginner)

**URL:** <https://forum.ansible.com/t/yaml-syntax-error-beginner/14995>\
**Category:** Ansible Project\
**Created:** [April 11, 2014, 7:20am UTC](https://forum.ansible.com/t/yaml-syntax-error-beginner/14995 "2014-04-11T07:20:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WS1](https://avatars.discourse-cdn.com/v4/letter/w/b3f665/32.png) [@WS1](https://forum.ansible.com/u/WS1)\
**Post date:** [April 11, 2014, 7:20am UTC](https://forum.ansible.com/t/yaml-syntax-error-beginner/14995/1 "2014-04-11T07:20:04Z")

</div>

Hello

I just started to use ansible so please bear with me. I managed to run a few basic playbooks but I am stuck with the following one (basic as well):

`

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [April 11, 2014, 4:06pm UTC](https://forum.ansible.com/t/yaml-syntax-error-beginner/14995/2 "2014-04-11T16:06:48Z")

</div>

It seems like the error is pointing out that action: is not aligned with name: I’m not sure what editor you are using but perhaps you could replace all tabs with spaces and then make sure things are lined up correctly.

---

<div class="post-metadata">

**Author:** ![Brian\_Green](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@Brian\_Green](https://forum.ansible.com/u/Brian_Green)\
**Post date:** [April 11, 2014, 6:24pm UTC](https://forum.ansible.com/t/yaml-syntax-error-beginner/14995/3 "2014-04-11T18:24:21Z")

</div>

While this may not be the cause of your issues, the following is (or will be) an issue for you.

- name: ensure joe is installed yum  
apt: name=joe state=latest  
when: ansible\_os\_family == “CentOS” or ansible\_os\_family == “Fedora”

change to:

- name: ensure joe is installed yum  
yum: name=joe state=latest  
when: ansible\_os\_family == “CentOS” or ansible\_os\_family == “Fedora”

---

<div class="post-metadata">

**Author:** ![WS1](https://avatars.discourse-cdn.com/v4/letter/w/b3f665/32.png) [@WS1](https://forum.ansible.com/u/WS1)\
**Post date:** [April 12, 2014, 2:17pm UTC](https://forum.ansible.com/t/yaml-syntax-error-beginner/14995/4 "2014-04-12T14:17:17Z")

</div>

Thank you for your help. I was not aware that tabs are not allowed (I finally RTFM, that is the YAML reference).

Changing this immediately helped.
