best practice for vagrantfile in roles?

46 views
Skip to first unread message

pixel fairy

unread,
Jan 11, 2016, 11:53:14 PM1/11/16
to Ansible Project
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.

Mischa ter Smitten

unread,
Jan 13, 2016, 3:22:24 AM1/13/16
to Ansible Project
We do it like this: https://github.com/Oefenweb/ansible-fail2ban in all our roles.

Never tested Windows, but I think it should work.

pixel fairy

unread,
Jan 14, 2016, 6:43:08 PM1/14/16
to Ansible Project

Ive been putting

ENV["ANSIBLE_ROLES_PATH"] = '..'

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

Larry Smith

unread,
Jan 15, 2016, 1:04:13 AM1/15/16
to Ansible Project
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.

Reply all
Reply to author
Forward
0 new messages