Jesus_Maria
Jesus_Maria

Reputation: 1207

Create a virtual machine for development with Vagrant

I am using nodejs with ansible and vagrant

I need to create a new machine for development with such things:

on every vagrant up I need to do:

How I can set these stuff to do automatically in vagrant or ansible?

Upvotes: 0

Views: 79

Answers (1)

Marc Young
Marc Young

Reputation: 4012

You have a few options:

  1. vagrant up, install your dependencies and repackage it as a box with: vagrant package or vagrant box repackage
  2. Use chef/puppet/ansible provisioners, or even the shell provisioner. This will allow it to happen on vagrant up or vagrant provision
  3. Roll your own in ruby and have vagrant run it (a vagrantfile is basically just ruby). I don't recommend this way.

I personally recommend 2 even though its the slowest (requires you to do all the owrk every time you destroy and up). 1 is a really good choice but I tend to keep vagrant as close to base state as possible so that no surprises pop up during deployment. And it makes it easier to share across people if you don't have to constantly re-package it and maintain that .box

Upvotes: 2

Related Questions