-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant-reload.rb
53 lines (42 loc) · 1.19 KB
/
vagrant-reload.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# this plugin was copied from https://github.com/aidanns/vagrant-reload
begin
require "vagrant"
rescue LoadError
raise "The Vagrant AWS plugin must be run within Vagrant."
end
# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < "1.2.0"
raise "The Vagrant Reload plugin is only compatible with Vagrant 1.2+"
end
module VagrantPlugins
module Reload
VERSION = "0.0.1"
class Plugin < Vagrant.plugin("2")
name "Reload"
description <<-DESC
The reload plugin allows a VM to be reloaded as a provisioning step.
DESC
provisioner "reload" do
class ReloadProvisioner < Vagrant.plugin("2", :provisioner)
def initialize(machine, config)
super
end
def configure(root_config)
end
def provision
options = {}
options[:provision_ignore_sentinel] = false
@machine.action(:reload, options)
begin
sleep 10
end until @machine.communicate.ready?
end
def cleanup
end
end
ReloadProvisioner
end
end
end
end