# Any Tool to write ansible because to many syntax issue are getting in terminal.?

**URL:** <https://forum.ansible.com/t/any-tool-to-write-ansible-because-to-many-syntax-issue-are-getting-in-terminal/29071>\
**Category:** Ansible Project\
**Created:** [November 20, 2018, 4:03am UTC](https://forum.ansible.com/t/any-tool-to-write-ansible-because-to-many-syntax-issue-are-getting-in-terminal/29071 "2018-11-20T04:03:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linux\_Tech](https://avatars.discourse-cdn.com/v4/letter/l/54ee81/32.png) [@Linux\_Tech](https://forum.ansible.com/u/Linux_Tech)\
**Post date:** [November 20, 2018, 4:03am UTC](https://forum.ansible.com/t/any-tool-to-write-ansible-because-to-many-syntax-issue-are-getting-in-terminal/29071/1 "2018-11-20T04:03:56Z")

</div>

when ever i try to write something in ansible yml file it always show me syntax error.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [November 20, 2018, 4:05am UTC](https://forum.ansible.com/t/any-tool-to-write-ansible-because-to-many-syntax-issue-are-getting-in-terminal/29071/2 "2018-11-20T04:05:59Z")

</div>

well a lot of this tools are to do that more automated or give you more insight before you get to the point of running them.

---

<div class="post-metadata">

**Author:** ![cyril.stoll1](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@cyril.stoll1](https://forum.ansible.com/u/cyril.stoll1)\
**Post date:** [November 20, 2018, 5:34pm UTC](https://forum.ansible.com/t/any-tool-to-write-ansible-because-to-many-syntax-issue-are-getting-in-terminal/29071/3 "2018-11-20T17:34:01Z")

</div>

Hi

> when ever i try to write something in ansible yml file it always show me syntax error.

Start by reading this: [https://docs.ansible.com/ansible/latest/reference\_appendices/YAMLSyntax.html](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html)

Beware of the spaces/intendation you use. If you have a list like this:

```auto
fruits:
    - Apple
    - Orange
    - Strawberry
    - Mango

```

All the dashes are in one line (column) and the dash starts 4 spaces after the line starts. Always write your yml files like this and avoid mixed intendations like:

```auto
fruits:
  - Apple
    - Orange
      - Strawberry
- Mango

```

You can also use the --syntax-check flag with ansible-playbook command on your yaml files. But it might produce errors even if there are none.

Furthermore if you start a new yaml file start with as less stuff in it as possible and test it out. Then add more stuff and test again. It is really hard to find a mistake in a 100 line long file. Much easier if you only have three lines. So start with

```auto
fruits:
    - Apple

```

Then when you can run that without errors you can add more fruits to the list etc.

Hope it helps,  
Cyril
