# How to run this playbook locally ?

**URL:** <https://forum.ansible.com/t/how-to-run-this-playbook-locally/23806>\
**Category:** Ansible Project\
**Created:** [February 24, 2017, 3:28pm UTC](https://forum.ansible.com/t/how-to-run-this-playbook-locally/23806 "2017-02-24T15:28:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Doe](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@John\_Doe](https://forum.ansible.com/u/John_Doe)\
**Post date:** [February 24, 2017, 3:28pm UTC](https://forum.ansible.com/t/how-to-run-this-playbook-locally/23806/1 "2017-02-24T15:28:55Z")

</div>

Hey,

I’ve got this playbook here [https://pastebin.mozilla.org/8980172](https://pastebin.mozilla.org/8980172)

and what I want is just run it locally. My plan is that I run this playbook from another playbook or in other words another playbook is referencing to this playbook and that works, but if I want to run this particular playbook locally - it fails and reason behind is I think so called play definitions. So I was wondering is there any way to run this locally ? By saying locally I mean ansible-playbook playbook.yml

Thanks

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 24, 2017, 4:49pm UTC](https://forum.ansible.com/t/how-to-run-this-playbook-locally/23806/2 "2017-02-24T16:49:57Z")

</div>

> Hey,
> 
> I've got this playbook here [https://pastebin.mozilla.org/8980172](https://pastebin.mozilla.org/8980172)

That's not a playbook, but a list of tasks.  
You should probably start by reading the docs  
[https://docs.ansible.com/ansible/playbooks\_intro.html](https://docs.ansible.com/ansible/playbooks_intro.html)

> and what I want is just run it locally. My plan is that I run this playbook  
> from another playbook or in other words another playbook is referencing to  
> this playbook and that works, but if I want to run this particular playbook  
> locally - it fails and reason behind is I think so called play definitions.  
> So I was wondering is there any way to run this locally ? By saying locally  
> I mean ansible-playbook playbook.yml

- hosts: localhost in a playbook will run the playbook on localhost.

---

<div class="post-metadata">

**Author:** ![John\_Doe](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@John\_Doe](https://forum.ansible.com/u/John_Doe)\
**Post date:** [February 24, 2017, 5:24pm UTC](https://forum.ansible.com/t/how-to-run-this-playbook-locally/23806/3 "2017-02-24T17:24:34Z")

</div>

I’ve added what you said and I’ve got this:

ERROR! Syntax Error while loading YAML.

The error appears to have been in ‘/xxx.yml’: line 3, column  
3, but may  
be elsewhere in the file depending on the exact syntax problem.
