Skip to content

Avoid installation path removal #151

@fgrehm

Description

@fgrehm

I've just started playing out with the Chef + Vagrant combo and while using vagrant-librarian-chef under vagrant-lxc I've hit an issue that vagrant-berkshelf users have reported to me in the past related to cookbooks installation.

The problem is this line and I worked around it by adding the code below to my Vagrantfile

require 'librarian/action'
class Librarian::Action::Install < Librarian::Action::Base
  def create_install_path
    if install_path.exist?
      FileUtils.rm_rf("#{install_path}/.", secure: true)
    end
    install_path.mkpath
  end
end

The problem with the current approach of recreating the whole directory messes up with vagrant-lxc shared folders / bind mounts and the guest container is no longer able to see the updated cookbooks after vagrant-librarian-chef kicks in. Without that change I can only provision my containers once and I'm not able to run vagrant provision after the machine is up.

I've already submitted a PR for Berkshelf and I'm up for doing the same here if you guys are up for doing the change :)

/cc @jimmycuadra

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions