Sha256: 380d510ffcf3642138601d331e2d93d77b0bb214b5f74bd4deacb962c264afed

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

module Berkshelf::Vagrant
  # @author Jamie Winsor <reset@riotgames.com>
  class Plugin < ::Vagrant.plugin("2")
    class << self
      def provision(hook)
        hook.after(Vagrant::Action::Builtin::Provision, Berkshelf::Vagrant::Action.upload)
        hook.after(Vagrant::Action::Builtin::Provision, Berkshelf::Vagrant::Action.install)
        hook.before(Vagrant::Action::Builtin::ConfigValidate, Berkshelf::Vagrant::Action.setup)
      end
    end

    name "berkshelf"
    description <<-DESC
    Automatically make available cookbooks to virtual machines provisioned by Chef Solo
    or Chef Client using Berkshelf.
    DESC

    action_hook(:berkshelf_provision, :machine_action_up, &method(:provision))
    action_hook(:berkshelf_provision, :machine_action_provision, &method(:provision))

    action_hook(:berkshelf_cleanup, :machine_action_destroy) do |hook|
      # @todo this should be appended to the middleware stack instead of hooked in after the
      #   Virtualbox specific destroy step but there is a bug in Vagrant (1.1.0) which
      #   causes appended middleware to run multiple times.
      hook.after(VagrantPlugins::ProviderVirtualBox::Action::DestroyUnusedNetworkInterfaces, Berkshelf::Vagrant::Action.clean)
    end

    config(:berkshelf) do
      Berkshelf::Vagrant::Config
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
berkshelf-vagrant-1.0.4 lib/berkshelf/vagrant/plugin.rb
berkshelf-vagrant-1.0.3 lib/berkshelf/vagrant/plugin.rb
berkshelf-vagrant-1.0.0.rc1 lib/berkshelf/vagrant/plugin.rb