Module: Berkshelf::Vagrant::Action

Defined in:
lib/berkshelf/vagrant/action.rb,
lib/berkshelf/vagrant/action/clean.rb,
lib/berkshelf/vagrant/action/set_ui.rb,
lib/berkshelf/vagrant/action/upload.rb,
lib/berkshelf/vagrant/action/install.rb,
lib/berkshelf/vagrant/action/load_shelf.rb,
lib/berkshelf/vagrant/action/configure_chef.rb

Defined Under Namespace

Classes: Clean, ConfigureChef, Install, LoadShelf, SetUI, Upload

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)


45
46
47
48
49
50
# File 'lib/berkshelf/vagrant/action.rb', line 45

def clean
  @clean ||= ::Vagrant::Action::Builder.new.tap do |b|
    b.use setup
    b.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)


20
21
22
23
24
# File 'lib/berkshelf/vagrant/action.rb', line 20

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

.setupObject



52
53
54
55
56
57
58
59
# File 'lib/berkshelf/vagrant/action.rb', line 52

def setup
  @setup ||= ::Vagrant::Action::Builder.new.tap do |b|
    b.use ::Vagrant::Action::Builtin::EnvSet, berkshelf: Berkshelf::Vagrant::Env.new
    b.use Berkshelf::Vagrant::Action::SetUI
    b.use Berkshelf::Vagrant::Action::LoadShelf
    b.use Berkshelf::Vagrant::Action::ConfigureChef
  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)


34
35
36
37
38
# File 'lib/berkshelf/vagrant/action.rb', line 34

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