Module: Berkshelf::Vagrant::Middleware

Defined in:
lib/berkshelf/vagrant/middleware.rb

Overview

Middleware stacks for use with Vagrant

Author:

Class Method Summary collapse

Class Method Details

.clean::Vagrant::Action::Builder

Return the Berkshelf clean middleware stack. When placed in the action chain this stack will clean up any temporary directories or files created by the other middleware stacks.

Returns:

  • (::Vagrant::Action::Builder)


43
44
45
46
47
48
# File 'lib/berkshelf/vagrant/middleware.rb', line 43

def clean
  @clean ||= ::Vagrant::Action::Builder.new do
    use Berkshelf::Vagrant::Action::SetUI
    use Berkshelf::Vagrant::Action::Clean
  end
end

.install::Vagrant::Action::Builder

Return the Berkshelf install middleware stack. When placed in the action chain this stack will find retrieve and resolve the cookbook dependencies describe in your configured Berksfile.

Cookbooks will installed into a temporary directory, called a Shelf, and mounted into the VM. This mounted path will be appended to the chef_solo.cookbooks_path value.

Returns:

  • (::Vagrant::Action::Builder)


16
17
18
19
20
21
# File 'lib/berkshelf/vagrant/middleware.rb', line 16

def install
  @install ||= ::Vagrant::Action::Builder.new do
    use Berkshelf::Vagrant::Action::SetUI
    use Berkshelf::Vagrant::Action::Install
  end
end

.upload::Vagrant::Action::Builder

Return the Berkshelf upload middleware stack. When placed in the action chain this stack will upload cookbooks to a Chef Server if the Chef-Client provisioner is used. The Chef Server where the cookbooks will be uploaded to is the same Chef Server used in the Chef-Client provisioner.

Nothing will be done if the Chef-Solo provisioner is used.

Returns:

  • (::Vagrant::Action::Builder)


31
32
33
34
35
36
# File 'lib/berkshelf/vagrant/middleware.rb', line 31

def upload
  @upload ||= ::Vagrant::Action::Builder.new do
    use Berkshelf::Vagrant::Action::SetUI
    use Berkshelf::Vagrant::Action::Upload
  end
end