vagrantfile

When i do a vagrant provisioning, can i ignore some provision codes from Vagrantfile on vagrant reload?

末鹿安然 提交于 2020-01-24 12:55:06
问题 In my Vagrantfile, I have two shell provisions: one is for installing system dependencies for my project, and another is for starting up nginx server. So what I wanted to have is when I vagrant reload --provision , can I ignore the provision for installing the system dependencies, and just start up the nginx server instead? Sample code: VAGRANTFILE_API_VERSION = '2' Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ... # Ignore this line on VM reload config.vm.provision 'shell', path:

translate vagrant statements in docker statements

。_饼干妹妹 提交于 2020-01-07 08:37:25
问题 I have to translate a vagrant file in docker commands for setting up a test server. I have no experiance in using docker and for the following command I found no solution. Vagrant.configure("2") do |config| config.vm.network(:forwarded_port, guest: 5432, host: 5432, host_ip: "127.0.0.1") I tried something like docker network create --gateway 127.0.0.1 forwarded_port But I found no way to set the ports and I'm not sure if "forwarded_port" is the name for my network or an argument for a method

How use local environment variable with Vagrant?

ぃ、小莉子 提交于 2020-01-06 20:15:33
问题 I'm passing my local environment variables like this: # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |de| de.vm.box = 'ubuntu/trusty64' de.vm.hostname = 'virtual_machine' de.vm.network 'public_network', bridge:ENV['NETWORK_INTERFACE'], ip:'192.168.2.170' de.vm.provider "virtualbox" do |v| v.memory = 4096 v.cpus = 2 end de.vm.synced_folder '.', '/vagrant', disabled:true de.vm.synced_folder '../../synced/shared/', '/shared/' de.vm.synced_folder '../../synced/devops/', '/devops

How to template Vagrantfile using Ruby?

孤人 提交于 2020-01-05 02:22:24
问题 I have several Vagrantfile , each one for a different provider , since Vagrant has a limitation that doesn't allow to make two or more provisions at the same time using the same Vagrantfile . So, I split into two or more Vagrantfiles , but my "body", my provisions scripts are the same for both, the only thing that changes is the provider block. For example: local_nagios/Vagrantfile # -*- mode: ruby -*- # vi: set ft=ruby : require 'yaml' set = YAML.load_file '../../../settings.yaml' Vagrant

Cabal getting installed in root directory instead of /home/vagrant directory using Vagrantfile

扶醉桌前 提交于 2020-01-04 05:23:07
问题 THe below is the content of the vagrant file. When I run vagrant up command, it installs cabal as required but it is in the root directory. Hence, it becomes unusable. I want to update the cabal version to latest version using cabal update . But it is not happening. Finally, in my VM, I have old version of cabal which comes with haskell-platform which is of no use to me. However, when I execute these commands separately by explicitly logging into VM, and not putting anything in Vagrantfile,

How to enable hot reloading via shared folders with Vagrant VM?

眉间皱痕 提交于 2020-01-04 03:55:52
问题 I have a very basic react/redux app utilizing hot reloading (i.e. when I save a change to my source code, it updates the contents of my app accordingly in browser, preserving the state of my app) via webpack. This works on myhost machine. However, if I use a vagrant-based workflow with synced folders (so that I can use my preferred non-terminal text editor) and I make and save a change to my source code on my host machine, the hot reloading is not triggered. However, if I make/save the change

Vagrant box could not be found error

拟墨画扇 提交于 2020-01-02 06:22:09
问题 I am trying to set up virtual machine using virtual box. I have got virtual box and vagrant installed in my windows 7 64-bit machine. I have also built an environment using puphpet. But whenever I try to install the box ubuntu1404-x64 it throws the error Bringing machine 'machine1' up with 'virtualbox' provider... ==>Machine1: Box 'puphpet/ubuntu1404-x64' could not be found. Attempting to find and install... machine1: Box Provider: virtualbox machine1: Box Version: >= 0 machine1: Box file was

GuestAdditions version mismatch

时光总嘲笑我的痴心妄想 提交于 2020-01-02 03:11:54
问题 when I use this command: vagrant up I obtain this error: [machine1] GuestAdditions versions on your host (4.3.36) and guest (5.0.10) do not match. how can I update guest addition from ubuntu shell? 回答1: Use the vagrant vbguest plugin Install the plugin: vagrant plugin install vagrant-vbguest Let vagrant up it will install the virtual box client if needed. If you want to force the installation you can run vagrant vbguest --do install 回答2: You need to upgrade your VBoxGuestAdditions ISO either

Vagrant - set the location of the virtual hard drive for VirtualBox

醉酒当歌 提交于 2020-01-01 04:22:11
问题 I have executed following commands (on Windows, using Git Bash) in the directory D:\vagrant\precise32\02-lamp\ $ vagrant box add precise32 http://files.vagrantup.com/precise32.box $ vagrant init precise32 $ vagrant up Note. I haven't changed original Vagrantfile. I thought the directory D:\vagrant\precise32\02-lamp\ would be the place of the VDI-like file but it is not. The working directory serves as the shared folder . I found the location of the Vagrant box C:\Users\USER\.vagrant.d\boxes

Changing Vagrantfile causes “vagrant ssh” to prompt for a password?

久未见 提交于 2019-12-29 04:37:15
问题 I've been playing around with setting up an environment using Vagrant, and I'm having an issue with the vagrant ssh command. When I change the path of the mounted share folder in the Vagrantfile, and do a vagrant reload , I'm no longer able to vagrant ssh without it asking me for a password. This was my original configuration for a mounted share, which works: config.vm.synced_folder "./", "/home/vagrant/shared" This is what I was trying to change to and it doesn't work after vagrant reload