# Testing roles

**URL:** <https://forum.ansible.com/t/testing-roles/23763>\
**Category:** Ansible Project\
**Created:** [February 17, 2017, 9:24pm UTC](https://forum.ansible.com/t/testing-roles/23763 "2017-02-17T21:24:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_WH](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Matt\_WH](https://forum.ansible.com/u/Matt_WH)\
**Post date:** [February 17, 2017, 9:24pm UTC](https://forum.ansible.com/t/testing-roles/23763/1 "2017-02-17T21:24:00Z")

</div>

Hi everyone,

I’m working on an Ansible setup where it would be extremely helpful to be able to test roles and changes to a role before they were moved into the roles folder used by ansible, as defined in the /etc/ansible/ansible.cfg file. Ideally it could check all the roles in a specified folder for syntax to help prevent issues from getting into the “live” folder so to speak. Does anyone know of a way to do this? Thank you!

---

<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 20, 2017, 7:32pm UTC](https://forum.ansible.com/t/testing-roles/23763/2 "2017-02-20T19:32:20Z")

</div>

Put the code in a version control system like Git.  
Then you can have different feature branches that get merged in to production branch when they are tested.

---

<div class="post-metadata">

**Author:** ![Mischa\_ter\_Smitten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mischa\_ter\_Smitten](https://forum.ansible.com/u/Mischa_ter_Smitten)\
**Post date:** [February 21, 2017, 7:19pm UTC](https://forum.ansible.com/t/testing-roles/23763/3 "2017-02-21T19:19:39Z")

</div>

I would also recommend automated testing using Travis-CI or Jenkins, see:

[https://github.com/Oefenweb/ansible-supervisor/blob/master/.travis.yml](https://github.com/Oefenweb/ansible-supervisor/blob/master/.travis.yml)
