# How do you validate the Yaml file before Ansible it?

**URL:** <https://forum.ansible.com/t/how-do-you-validate-the-yaml-file-before-ansible-it/12361>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [February 15, 2013, 7:54pm UTC](https://forum.ansible.com/t/how-do-you-validate-the-yaml-file-before-ansible-it/12361 "2013-02-15T19:54:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 15, 2013, 7:54pm UTC](https://forum.ansible.com/t/how-do-you-validate-the-yaml-file-before-ansible-it/12361/1 "2013-02-15T19:54:47Z")

</div>

ansible-playbook has a --check-syntax option.

In 1.1, it's a little smarter, and there is a --list-tasks to go along  
with --list-hosts.

---

<div class="post-metadata">

**Author:** ![Robert\_Blankenship](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@Robert\_Blankenship](https://forum.ansible.com/u/Robert_Blankenship)\
**Post date:** [March 12, 2016, 2:30am UTC](https://forum.ansible.com/t/how-do-you-validate-the-yaml-file-before-ansible-it/12361/2 "2016-03-12T02:30:09Z")

</div>

I think that  
`ansible-playbook --syntax-check`

is the correct command, not

`ansible-playbook --check-syntax`
