Sha256: 2ac49038d47fa51b567861332fcff8b54c13c9e2764a0b18c7a971f3ec074b9a

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

module VagrantPlugins
  module Cachier
    class Plugin < Vagrant.plugin('2')
      action_hook VagrantPlugins::Cachier::Plugin::ALL_ACTIONS do |hook|
        require_relative 'action/configure_bucket_root'
        require_relative 'action/install_buckets'

        hook.before Vagrant::Action::Builtin::Provision, Action::ConfigureBucketRoot
        # This will do the initial buckets installation
        hook.after Vagrant::Action::Builtin::Provision, Action::InstallBuckets, chmod: true
      end

      # This ensure buckets are reconfigured after provisioners runs
      action_hook :provisioner_run do |hook|
        require_relative 'action/install_buckets'
        hook.after :run_provisioner, Action::InstallBuckets
      end

      clean_action_hook = lambda do |hook|
        require_relative 'action/clean'
        hook.before Vagrant::Action::Builtin::GracefulHalt, Action::Clean
      end
      action_hook 'remove-guest-symlinks-on-halt',    :machine_action_halt,    &clean_action_hook
      action_hook 'remove-guest-symlinks-on-package', :machine_action_package, &clean_action_hook
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vagrant-cachier-1.2.1 lib/vagrant-cachier/hooks.rb
vagrant-cachier-1.2.0 lib/vagrant-cachier/hooks.rb
vagrant-cachier-1.1.0 lib/vagrant-cachier/hooks.rb
vagrant-cachier-1.0.0 lib/vagrant-cachier/hooks.rb
vagrant-cachier-0.9.0 lib/vagrant-cachier/hooks.rb
vagrant-cachier-0.8.0 lib/vagrant-cachier/hooks.rb
vagrant-cachier-0.7.2 lib/vagrant-cachier/hooks.rb
vagrant-cachier-0.7.1 lib/vagrant-cachier/hooks.rb
vagrant-cachier-0.7.0 lib/vagrant-cachier/hooks.rb
vagrant-cachier-0.6.0 lib/vagrant-cachier/hooks.rb