berkshelf / vagrant-berkshelf

A Vagrant plugin to add Berkshelf integration to the Chef provisioners
Other
378 stars 100 forks source link

Berkshelf contains base VM #229

Closed alappe closed 10 years ago

alappe commented 10 years ago

We're using vagrant-berkshelf with the following directory structure:

Box
  .vagrant/
    machines/
      …
  Berksfile
  Vagrantfile
  attributes/
    default.rb
  recipes/
    default.rb
    …
  templates/
    default/
      …

On vagrant up, berkshelf is building the dependencies into the shelf:

==> default: Cloning VMware VM: 'ACME-CentOS-6.5-64-VMWare'. This can take some time...
==> default: Verifying vmnet devices are healthy...
Updating Vagrant's berkshelf: '/Users/nd/.berkshelf/default/vagrant/berkshelf-20141027-99257-11msjqj-default'
Resolving cookbook dependencies...
Fetching 'acme-base' from source at .
Using 7-zip (1.0.2)
Using acme-base (0.1.4) from source at .
Using ant (1.0.2)
…

This gets rather big:

nd@style /Users/nd/.berkshelf/default/vagrant ♥ du -sh berkshelf-20141027-99257-11msjqj-default
2.1G    berkshelf-20141027-99257-11msjqj-default

The problem is, that the cookbook acme-base is our main cookbook, which is copied into the global berkshelf including the .vagrant directory, which contains the base VM at that point.

So I wonder if there's an easy way to exclude the VM from being copied or if this structure is entirely broken, in which case I'd be happy to get a hint for a better one?

Versions:

Berkshelf 3.1.5
vagrant-berkshelf 3.0.1
vagrant 1.6.5
sethvargo commented 10 years ago

Don't check the .vagrant directory into source and/or add it to your chefignore file.

alappe commented 10 years ago

It's ignored in git, but I will try .chefignore, thanks!

sethvargo commented 10 years ago

@alappe it's not .chefignore, it's chefignore. Don't ask why :frowning:

alappe commented 10 years ago

Just saw it while generating a vanilla one… thanks!