# roles will not run against localhost

**URL:** <https://forum.ansible.com/t/roles-will-not-run-against-localhost/31542>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 25, 2019, 3:19am UTC](https://forum.ansible.com/t/roles-will-not-run-against-localhost/31542 "2019-10-25T03:19:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [October 25, 2019, 3:19am UTC](https://forum.ansible.com/t/roles-will-not-run-against-localhost/31542/1 "2019-10-25T03:19:19Z")

</div>

I have some complex aws related tasks that I would like to move into a role.  
However, when I run the play against localhost, the role never runs.

After much troubleshooting, I finally created a brand new repo that just tries to use debug to print something. Directly in a task works fine. In a role does not (i.e. it never runs the code).

I’ve only tried this on ansible 2.8.

Simple repro repo: [https://github.com/senorsmile/ansible-localhost-role-broken](https://github.com/senorsmile/ansible-localhost-role-broken)

---

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [October 25, 2019, 4:15am UTC](https://forum.ansible.com/t/roles-will-not-run-against-localhost/31542/2 "2019-10-25T04:15:41Z")

</div>

Someone on IRC sorted me out. I needed a tasks folder to put the main.yml into.
