# best practice for vagrantfile in roles?

**URL:** <https://forum.ansible.com/t/best-practice-for-vagrantfile-in-roles/20174>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 12, 2016, 4:53am UTC](https://forum.ansible.com/t/best-practice-for-vagrantfile-in-roles/20174 "2016-01-12T04:53:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [January 12, 2016, 4:53am UTC](https://forum.ansible.com/t/best-practice-for-vagrantfile-in-roles/20174/1 "2016-01-12T04:53:14Z")

</div>

Is there any consensus on where to put a Vagrantfile for testing?

The most straight forward ive seen is the vagrant file in the root of the roles folder with a folder called roles for vagrant to pick up on, and a symlink in there to ‘…’ (pointing back to the root of the role folder) which is great until you try it on windows.

another approach is a folder with the role(s) inside, as done with ceph. but then you cant just drop them into your roles folder.

---

<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:** [January 13, 2016, 8:22am UTC](https://forum.ansible.com/t/best-practice-for-vagrantfile-in-roles/20174/2 "2016-01-13T08:22:23Z")

</div>

We do it like this: [https://github.com/Oefenweb/ansible-fail2ban](https://github.com/Oefenweb/ansible-fail2ban) in all our roles.

Never tested Windows, but I think it should work.

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [January 14, 2016, 11:43pm UTC](https://forum.ansible.com/t/best-practice-for-vagrantfile-in-roles/20174/3 "2016-01-14T23:43:08Z")

</div>

Ive been putting

ENV[“ANSIBLE\_ROLES\_PATH”] = ‘…’

in my vagrant files. but i like your way better.

---

<div class="post-metadata">

**Author:** ![Larry\_Smith1](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@Larry\_Smith1](https://forum.ansible.com/u/Larry_Smith1)\
**Post date:** [January 15, 2016, 6:04am UTC](https://forum.ansible.com/t/best-practice-for-vagrantfile-in-roles/20174/4 "2016-01-15T06:04:13Z")

</div>

I have began to include a Vagrantfile to spin up some roles as well. Also starting to include a Dockerfile with some as well. Here are two examples.

[https://github.com/mrlesmithjr/ansible-snort](https://github.com/mrlesmithjr/ansible-snort)  
[https://github.com/mrlesmithjr/ansible-graylog](https://github.com/mrlesmithjr/ansible-graylog)
