vagrantfile

Ruby unexpected ':', expecting kEND

拟墨画扇 提交于 2019-12-11 06:30:05
问题 I want to set up vagrant on my Ubuntu, when "vagrant up", it always give me the following error syntax error, unexpected ':', expecting kEND config.vm.provision :shell, path: "vagrantprov.sh" I checked the Vagrantfile, it should be OK, can anyone tell me where the error is? Thanks. # -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config

Vagrant communication between guest machines

隐身守侯 提交于 2019-12-11 04:26:30
问题 I have multiple Vagrant machines like so: config.vm.define 'vagrant1' do |vagrant1| config.vm.provider :virtualbox do |vb| vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on'] end vagrant1.vm.box = 'ubuntu/trusty64' vagrant1.vm.network 'forwarded_port', guest: 80, host: 8080 vagrant1.vm.network 'forwarded_port', guest: 443, host: 8443 vagrant1.vm.network 'forwarded_port', guest: 27017, host: 27017 # Create a private network, which allows host-only access to the machine # using a

How to “vagrant up” multiple nodes at a time?

允我心安 提交于 2019-12-11 04:14:36
问题 I have a Vagrantfile with multiple nodes defined - say node1, node2, node3. I want to run a single command "vagrant up --provision node1,node2" but this doesn't seem to be possible in one command line, the only way seems to run 2 commands in parallel: "vagrant up --provision node1" "vagrant up --provision node2" Anybody has a workaround to suggest? A Vagrantfile is a Ruby script, so maybe enriching it with some syntax can get the job done... but I have no Ruby skills... 回答1: You can use a

Error setting VM Storage size in Vagrant

老子叫甜甜 提交于 2019-12-11 02:25:57
问题 I'm following this link https://github.com/acfreitas/oraclebox I tried to include the code for setting up VM storage size on my Vagrant. But i'm getting error like below. ==> vagrant: Running provisioner: shell... vagrant: Running: C:/Users/skywork/AppData/Local/Temp/vagrant-shell20151111-11660-1l3hhe.sh ==> vagrant: ++ '[' grep -ic 64GB /sizeDisk ']' ==> vagrant: /tmp/vagrant-shell: line 4: [: too many arguments ==> vagrant: ++ sudo fdisk -u /dev/sdb ==> vagrant: Welcome to fdisk (util-linux

Vagrant+Puppet puppet.module_path not working

最后都变了- 提交于 2019-12-10 20:31:41
问题 So I have my Vagrant file set up like this: VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "hashicorp/precise64" config.vm.provision "puppet" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "site.pp" puppet.module_path = "modules" puppet.options = "--verbose --debug" end end Now when I vagrant ssh into my VM and then run puppet module install puppetlabs-apache , i get the following error: Error: Could not install

Vagrant folder permissions using nginx

萝らか妹 提交于 2019-12-10 17:44:50
问题 I am new to vagrant and having issues getting working correctly. It is running fine with port forwarding and I can access it. However I am having trouble getting bower and gulp to work correctly. The issue seems to stem from the /var/www directory being owned by www-data/www-data. The vagrant user doesn't have write permissions to any of the directories even after adding vagrant to the www-data group. I am no even able to use sudo chmod to add the write permission to any file. I get no access

Vagrant::Errors::NetworkCollision: The specified host network collides with a non-hostonly network

风流意气都作罢 提交于 2019-12-10 10:05:56
问题 I'm using vagrant with multiple machine, it's ever worked normally, but then it just doesn't work again. My part of Vagrantfile that defining the network: config.vm.define "app" do |layer| layer.vm.provision "chef_solo", id:"chef" do |chef| ..... end # Forward port 80 so we can see our work layer.vm.network "forwarded_port", guest: 80, host: 9999 layer.vm.network "private_network", ip: "10.10.10.10" end It's a standar configuration and I only have that vm. But when I tried to vagrant up , it

Answering prompt using vagrant file?

牧云@^-^@ 提交于 2019-12-10 01:01:08
问题 Is it possible to add a script to a Vagrantfile that answers a prompt. I am provisioning a ubuntu box for docker config.vm.box = "ubuntu" config.vm.provision :shell, :inline => "sudo apt-get update" config.vm.provision :shell, :inline => "sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring" After running the last command, there is a prompt that asks Do you want to continue [Y/n]? 回答1: An easier solution would be to use the -y option of apt-get : config.vm

Vagrant: can't get NFS working

瘦欲@ 提交于 2019-12-09 16:12:06
问题 I'm trying to change my VagrantFile so that it uses an NFS mount instead of the default VirtualBox shared folders. I get this error message: vm: * Shared folders that have NFS enabled do not support owner/group attributes. Host path: . This is my VagrantFile: VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ktbartholomew/lamp" config.vm.network "private_network", type: "dhcp" config.vm.synced_folder ".", "/vagrant", type: "nfs" end I can't

Vagrant synced folder permissions

北城以北 提交于 2019-12-09 15:00:15
问题 I have set up a synced folder in Vagrant, from my Windows host to the guest. Initially the permissions on the files were too open so I added the following mount options: config.vm.synced_folder "../my-folder", "/home/vagrant/my-folder", mount_options: ["dmode=775,fmode=664"] However, I need to add execute permissions on a single file within this folder. chmod +x file has no effect. Is there a way to allow a single item in a shared folder to be executable/have different permissions to the rest