Questions tagged [vagrantfile]

Vagrantfiles are configuration files for vagrant. The Vagrantfile describes the type of virtual machine, and how to configure and provision the vm.

The primary function of the Vagrantfile is to describe the type of machine required for a project, and how to configure and provision these machines. Vagrantfile are called Vagrantfiles because the actual literal filename for the file is Vagrantfile (casing doesn't matter).

Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control. This allows other developers involved in the project to check out the code, run vagrant up, and be on their way. Vagrantfiles are portable across every platform Vagrant supports.

The syntax of Vagrantfiles is , but knowledge of the programming language is not necessary to make modifications to the Vagrantfile, since it is mostly simple variable assignment. In fact, isn't even the most popular community Vagrant is used within, which should help show you that despite not having Ruby knowledge, people are very successful with Vagrant.

1000 questions
3
votes
2 answers

host_vars and group_vars are not getting loaded

I have below folder structure, which seem to make it build and load the roles, but the group and host vars are not being loaded. How come? /etc/ansible/ - hosts - requirements.yml - group_vars/ - app/ - postgres.yml - host_vars/ -…
Peter Pik
  • 11,023
  • 19
  • 84
  • 142
3
votes
1 answer

Syntax error in Vagrant

I'm have this code in my Vagrantfile to use Ansible to provision my virtual machine: Vagrant.configure("2") do |config| config.vm.box = "geerlingguy/centos7" config.vm.provision "ansible" do |ansible| ansible.playbook =…
VaTo
  • 2,936
  • 7
  • 38
  • 77
3
votes
1 answer

Vagrant up : bad interpreter: No such file or directory

Facing the following error while running vagrant up via cygwin. stderr: /bin/bash: /home/vagrant/.ansible/tmp/ansible-tmp-1487226010.33-231113224080537/configure.sh: /bin/bash^M: bad interpreter: No such file or directory When checked, I cant…
Nidheesh
  • 4,390
  • 29
  • 87
  • 150
3
votes
1 answer

Vagrant in silent/quiet mode

I would like to disable the stdout for Vagrant, at the moment it prints all the steps as it goes through the Vagrantfile, how can I make vagrant to show failure or warning only? I use puppet and shell provisioner with it. I don't want to see this…
MMT
  • 1,931
  • 3
  • 19
  • 35
3
votes
3 answers

Unable to SSH to vagrant Ubuntu 16.04?

I create very simple Vagrantfile: # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "boxcutter/ubuntu1604" config.vm.hostname = "r1" config.vm.network "forwarded_port", guest: 3000, host: 3000 …
sharp
  • 857
  • 1
  • 9
  • 21
3
votes
0 answers

Vagrant HTTP 500 error

I'm currently working on project using Vagrant and I'm using Scotch Box 2.5. The setting up part was very successful even in SSH, I installed Apache and PHP 5.6. When I tried accessing to my site, it said HTTP 500 error. I also use VirtualHost…
Huy Le
  • 339
  • 1
  • 2
  • 11
3
votes
1 answer

How do I provision a personal database during first vagrant up?

We've got a multi-machine Vagrantfile in our project repo which sets up a LAMP stack and creates some common MySQL databases. Now, each of us also have a personal database that we'd like Vagrant to create as part of the initial "vagrant up"…
Johan Fredrik Varen
  • 3,796
  • 7
  • 32
  • 42
3
votes
2 answers

Vagrant on Windows can't vagrant-up and ssh connect

So I've watch many videos on Vagrant and it seems so simple: with VirtualBox and Vargant installed, simply specify the VM box's name in the Vagrantfile, run $ vagrant up and you should be able to $ vagrant ssh to it directly. However, a week-end…
TheWalkingPanda
  • 183
  • 3
  • 9
3
votes
0 answers

How to group multiple vagrant machines into one environment and another group of machines as another environment?

Hi lets say I have 4 machines defined in my Vagrantfile (this is just example), Vagrant.configure(2) do |config| config.vm.define "elasticsearch" do |a| a.vm.provider "docker" do |docker| docker.name = 'elasticsearch' …
3
votes
0 answers

Laravel - homestead.rb cannot be loaded

I used the homestead executable to install homestead in one of my laravel projects., when i vagrant up, i get the following error message; There was an error loading a Vagrantfile. The file being loaded and the error message are shown below. This…
Tom Morison
  • 564
  • 1
  • 8
  • 26
3
votes
0 answers

I would like to create a user/password to login to vagrant vm via VirtualBox GUI

I would like to use a username/password to log into a vagrant virtual machine via Virtualbox's GUI I'm new to Vagrant and I thought that I could login, through the virtualbox gui, using the following: username: vagrant password: vagrant However, it…
jlents
  • 790
  • 8
  • 20
3
votes
1 answer

I am asked for password of ubuntu user instead of vagrant (the user I'm logged in with in GUI)

I have a vagrant project, provisioned with ansible. For ssh settings I use: config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" config.ssh.forward_agent = true config.ssh.forward_x11 = true The problem is that I start the VM with GUI…
valentin_nasta
  • 596
  • 4
  • 23
3
votes
2 answers

Vagrant .vagrant file on Dropbox

I'm using Vagrant on two machines (home and office) with my working directories stored in Dropbox. I regularly run into the pronblem: The VirtualBox VM was created with a user that doesn't match the current user running Vagrant. VirtualBox requires…
Charlie Martin
  • 110,348
  • 25
  • 193
  • 263
3
votes
1 answer

Vagrant RSYNC permissions

Vagrant RSYNC folders have options for changing the owner and group (owner, group, rsync__chown), but what about permission levels for both file and directory (dmode, fmode, rsync__chmod)? It seems like the permissions for my synced folder are…
Coffee123
  • 156
  • 2
  • 9
3
votes
1 answer

How use local environment variable with Vagrant?

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',…
Valter Silva
  • 16,446
  • 52
  • 137
  • 218