Sha256: 6812230cff0adffae9703aea442088085dd81c5323919f57a9cfbf09fc3dac94

Contents?: true

Size: 1017 Bytes

Versions: 3

Compression:

Stored size: 1017 Bytes

Contents

require 'vagrant'
require 'auto_network/action'

module AutoNetwork
  class Plugin < Vagrant.plugin('2')
    name 'auto_network'

    description <<-DESC
    This plugin adds support for automatically configuring Vagrant hostonly
    networks.
    DESC

    action_hook('Auto network: initialize address pool') do |hook|
      hook.prepend AutoNetwork::Action::LoadPool
    end

    action_hook('Auto network: filter private networks', :environment_load) do |hook|
      action = AutoNetwork::Action::LoadPool
      hook.after(action, AutoNetwork::Action::FilterNetworks)
    end

    action_hook('Auto network: request address', :machine_action_up) do |hook|
      action = VagrantPlugins::ProviderVirtualBox::Action::Network
      hook.before(action, AutoNetwork::Action::Request)
    end

    action_hook('Auto network: release address', :machine_action_destroy) do |hook|
      action = VagrantPlugins::ProviderVirtualBox::Action::Destroy
      hook.before(action, AutoNetwork::Action::Release)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-auto_network-0.2.2 lib/auto_network/plugin.rb
vagrant-auto_network-0.2.1 lib/auto_network/plugin.rb
vagrant-auto_network-0.2.0 lib/auto_network/plugin.rb