How to generate .vagrant/machines/{machine}/aws/synced_folders file from VCS

23 views
Skip to first unread message

Ivan G

unread,
Apr 4, 2016, 4:47:59 AM4/4/16
to Vagrant

Hello

I need to solve a big problem, generating the .vagrant folder without stopping and restarting the VM's. 

We are using github to store the Vagrant file and the provision scripts, but not the .vagrant folder.

Every time you clone the repo in a different machine you do not know which servers are up and running and which are not.
Let's say I deliver the project to a customer with some of the VM's running and some stopped and the customer runs a 'vagrant status';
they don't see the running machines and if they try to run them, they will run NEW instances

I need to dump (re-generate) the .vagrant/machines/{{machine}}/aws folder and configurations.

There is anyway to do it? Probably tweaking with ruby inside the vagrant file or maybe including the Vagrantfile inside a .rb file you can get that info, but unfortunatelly I'm not ruby programmer.


Hope someone has a solution for that 

Thanks in advance.

Alvaro Miranda Aguilera

unread,
Apr 4, 2016, 8:01:39 AM4/4/16
to vagra...@googlegroups.com
Hello, 
You sure thats the best workflow?

Vagrant is meant on the simple side of things that each person can do vagrant up and have his own VM/AMI

Is you want all the people using the same one, then you can have some `server.env` file on the code, and perhaps you dont needed vagrant at all.

In the other hand, what you would do if one developer by mistake does vagrant destroy?



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/7fb8b6f0-c417-4b77-8f51-77aa04fb9d04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ivan G

unread,
Apr 4, 2016, 9:51:47 AM4/4/16
to vagra...@googlegroups.com

Thanks for your quick answer Alvaro.

I use triggers plugin to manage the events, so a destroy or an stop is not going to happen (through vagrant) if some conditions are not met for each VM

Also agree Vagrant is not the best approach. I am moving from it, but in the meantime I need to keep it. 

I only need (in reality) regenerate the .vagrant/machines/{machine}/aws/synced_folders.
Since two weeks ago I always used the same rsync configuration for all machines on all projects and simply wrote a default synced_folders file and copied amoing all the VM's. 

But now a couple of projects need every VM to have its own specific synced folder config and I am wondering if there is a simple way, probably from ruby, to get the configuration for each VM and dump it on files.


Thank you in advance!



--

Iván González Valiente

Systems Developer / AWS Certified Developer

Tel.  +34  675 962 588 

 

 


You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/aMAvegYs6bI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0eyyWUwt4KFqqiA%3DD7AnesQSdn7tU5Sckg4JUtFQE5ao8A%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages