2014-06-01 21:45:18 +00:00
|
|
|
require 'vagrant-hostmanager/hosts_file/updater'
|
|
|
|
|
2013-05-02 06:36:40 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module HostManager
|
|
|
|
class Provisioner < Vagrant.plugin('2', :provisioner)
|
|
|
|
|
2013-06-20 16:54:20 +00:00
|
|
|
def initialize(machine, config)
|
|
|
|
super(machine, config)
|
2014-06-01 21:45:18 +00:00
|
|
|
global_env = machine.env
|
|
|
|
@config = Util.get_config(global_env)
|
|
|
|
@updater = HostsFile::Updater.new(global_env, machine.provider_name)
|
2013-06-20 16:54:20 +00:00
|
|
|
end
|
|
|
|
|
2013-05-02 06:36:40 +00:00
|
|
|
def provision
|
2014-06-01 21:45:18 +00:00
|
|
|
@updater.update_guest(@machine)
|
2014-03-12 10:51:14 +00:00
|
|
|
if @config.hostmanager.manage_host?
|
2014-06-01 21:45:18 +00:00
|
|
|
@updater.update_host
|
2013-06-18 21:26:29 +00:00
|
|
|
end
|
2013-05-02 06:36:40 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|