vagrantfiles | My Vagrant files to setup dev environment | Plugin library
kandi X-RAY | vagrantfiles Summary
kandi X-RAY | vagrantfiles Summary
My Vagrant files to setup dev environment
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vagrantfiles
vagrantfiles Key Features
vagrantfiles Examples and Code Snippets
Community Discussions
Trending Discussions on vagrantfiles
QUESTION
I have configs that must always be present in Vagrantfile, when init is run, regardless of box.
For example when I run vagrant init ubuntu/trusty64
or vagrant init centos/7
this must be present in both Vagrantfiles:
ANSWER
Answered 2017-Feb-05 at 10:25By default you cant really change this behavior, unfortunately vagrant init
does not propose an option to use your own Vagrantfile (that would be neat but not there). There are 2 templates (see https://github.com/mitchellh/vagrant/tree/master/templates/commands/init) that can be used, the default one and a minimal one.
You're left with the following options:
- overwrite the default template
Vagrantfile.erb
search the file in your system (on mac it should be somewhere in /opt/vagrant/embedded/gems/gems/vagrant-1.9.1/templates/commands/init/Vagrantfile.erb
depending your version) and change it to what you need.
You can have a global
Vagrantfile
under the.vagrant.d
directory that will be applied to all your Vagrantfiles. See LOAD ORDER AND MERGING in vagrantfile documentation.Write a plugin with a new command to create the Vagrantfile. that is probably overkill though
QUESTION
I have had a number of issues recently with vagrant-berkshelf
not syncing Chef cookbooks on an existing machine reliably. And, basically, when doing research on workarounds, I see something like:
vagrant-berkshelf is deprecated, use Test Kitchen instead.
My use case is that I have Vagrantfile
s, used to build VMs and DigitalOcean droplets, that are hand-written and only use Chef to provision the VMs. I am most definitely approaching Chef as a user, not an author or tester of cookbooks.
So, I am in a case of Vagrant -> Chef
, not Chef -> Vagrant
.
When looking at Kitche-Vagrant, I see that:
The kitchen-vagrant driver for Kitchen generates a single Vagrantfile for each instance of Kitchen in a sandboxed directory..
My question is: if my workflow relies on hand-written, complex, Vagrantfiles, can I continue to use Chef as a provisioner without having to rely on vagrant-berkshelf
?
Some of the possible alternatives I see are:
mangle Test Kitchen configuration to work with my exiting Vagrantfile. I fear that this is not the intent of this tool and will not end well.
use
chef.cookbooks_path
attribute in vagrant and let it take the place of vagrant-berkshelf.switch out provisioners and use say Vagrant->Ansible.
The Vagrantfile below is somewhat simplified, but the gist is that the Vagrantfile is in charge and Chef is just used to provision.
...ANSWER
Answered 2018-Feb-28 at 21:45It isn't deprecated per se, but it does no longer have a maintainer and does highly recommend against its use. There is no replacement for the workflow you describe. Sorry. If you are interested in taking over as maintainer, I can put you in contact with the team.
QUESTION
I am currently setting up a development environment whereby there are two vagrant machines. The first hosts a website etc while the second hosts an API which the website calls. Currently my vagrantfiles are as follows:
API
...ANSWER
Answered 2018-Jan-27 at 08:49You need to put both VMs into the same private network and Website
VM will be able to reach API
VM via it:
QUESTION
I am trying to set up a server environment as follows:
- Physical Host machine: (192.168.0.106)
- Physical Laptop: (192.168.0.130)
On the host machine, I am trying to use vagrant to set up 2 Virtual Machines
- Virtual Machine 1 (VM_IP_1). Vagrant is set up to port forward 5555:8080. This machine will be running some sort of webserver, on port 8080
- Virtual Machine 2 (VM_IP_2).
I am trying to accomplish the following:
- From Physical Host Machine, I want to be able to open up a web browser, navigate to VM_IP_1:5555, and connect to the web server, displaying some web page
- From Laptop Machine, I want to be able to open up a web browser, navigate to VM_IP_1:5555, and connect to the web server, displaying some web page (same as 1)
- From Virtual Machine 2, I want to be able to open up a web browser, navigate to VM_IP_1:5555, and connect to the web server, displaying some web page (same as 1).
Is this even possible? I've spent the last 2 days, tinkering, trying to automate it, but no luck.
Basically, I want to simulate a non-trivial network architecture consisting of web servers, load balancers, databases, etc. I want to be able to test as if my single powerful server was a simulation of a network (i.e it would run 4 VMs) but also have the flexibility and re usability of my vagrant automation to be able to deploy to production something like (2 powerful servers, each running 2 VMS for a total of 4)
Everyone should be able to communicate with everyone (assuming I have the ports forwarded correctly - routing tables too)
Here are the VagrantFiles I've been playing around with. Tried with private_network but I don't think that's right. There's Host Only
but I don't think that's right eitherI am thinking that maybe I need to have some sort of reverse port_forwarding
from VM 2. But that doesn't sound right.
ANSWER
Answered 2017-Jun-29 at 06:59I usually work with private network
to achieve this, I am not sure why you're saying its right.
This is a quick example of a 3 VM setup with a load-balancer and 2 app servers (running node) so you can get the idea.
Private network is just a virtualbox internal network that is more secure than a bridge network (i.e. a vagrant public network)
Using a static IP anyway is your way to go, I am glad you figure that forward port is not necessary when using static IP (I've been saying this too many times and more)
QUESTION
I use nano for git commit messages. Short summary (<=50 chars) plus a new line before the description is relatively straightforward to stick to. However, when it comes to wrapping at 72 chars in the description body I just go off what seems to look right, making for inconsistent logs.
In Vagrantfiles I've seen this sort of thing to tell the editor what to do for vi/vim:
...ANSWER
Answered 2017-Feb-13 at 10:46Nano supports the passing of command line arguments when starting it.
This can be leveraged as part of the git editor config setting.
git config --global core.editor "nano -r 72"
Or:
export GIT_EDITOR='nano -r 72'
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vagrantfiles
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page