vagrant-rightscaleshim 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +20 -0
- data/README.md +55 -0
- data/lib/vagrant-rightscaleshim/action/clean_one_time_runlist_file.rb +43 -0
- data/lib/vagrant-rightscaleshim/action/cleanup.rb +43 -0
- data/lib/vagrant-rightscaleshim/action/config_chef_solo.rb +80 -0
- data/lib/vagrant-rightscaleshim/action.rb +46 -0
- data/lib/vagrant-rightscaleshim/config.rb +59 -0
- data/lib/vagrant-rightscaleshim/plugin.rb +63 -0
- data/lib/vagrant-rightscaleshim.rb +30 -0
- data/locales/en.yml +6 -0
- metadata +63 -0
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# vagrant-rightscaleshim
|
2
|
+
|
3
|
+
A Vagrant plugin which (along with [rightscaleshim](https://github.com/rgeyer-rs-cookbooks/rightscaleshim)) allows the use of RightScale specific Chef resources (right_link_tag, remote_recipe, server_collection) in a Vagrant VM.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install Vagrant 1.2.x from the [Vagrant downloads page](http://downloads.vagrantup.com/)
|
8
|
+
|
9
|
+
Install the Vagrant RightScale Shim plugin
|
10
|
+
|
11
|
+
$ vagrant plugin install vagrant-rightscaleshim
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
You can setup your vagrantfile thusly
|
16
|
+
Vagrant.configure("2") do |config|
|
17
|
+
config.vm.hostname = "centos"
|
18
|
+
|
19
|
+
config.vm.box = "ri_centos6.3_v5.8.8"
|
20
|
+
config.vm.box_url = "https://s3.amazonaws.com/rgeyer/pub/ri_centos6.3_v5.8.8_vagrant.box"
|
21
|
+
|
22
|
+
config.vm.network :private_network, ip: "33.33.33.10"
|
23
|
+
|
24
|
+
config.ssh.max_tries = 40
|
25
|
+
config.ssh.timeout = 120
|
26
|
+
|
27
|
+
config.rightscaleshim.run_list_dir = "runlists/centos"
|
28
|
+
config.rightscaleshim.shim_dir = "rightscaleshim/centos"
|
29
|
+
config.vm.provision :chef_solo do |chef|
|
30
|
+
# This intentionally left blank
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Then create some new runlists at runlists/default/new_runlist.json
|
35
|
+
|
36
|
+
Run some of the other runlists by copying them to rightscaleshim/default/dispatch
|
37
|
+
|
38
|
+
cp runlists/default/new_runlist.json rightscaleshim/default/dispatch/
|
39
|
+
vagrant provision
|
40
|
+
|
41
|
+
Or specifying a "runlist" environment variable
|
42
|
+
|
43
|
+
runlist=new_runlist vagrant provision
|
44
|
+
|
45
|
+
## Features
|
46
|
+
|
47
|
+
Uses JSON files which are essentially Chef-Solo node.json files as "runlists". As shown above you can specify a runlist to execute, or if there is a runlist file in the "dipatch" directory of a particular VM, the next `vagrant provision` execution will run it and delete the file in the dispatch directory.
|
48
|
+
|
49
|
+
Tag data is stored in rightscaleshim/#{vnname}/persist.json and used to simulate the functionality of the right_link_tag resource.
|
50
|
+
|
51
|
+
The following RightScale/RightLink specific resoures are stubbed/simulated by this gem and cookbook
|
52
|
+
|
53
|
+
* right_link_tag
|
54
|
+
* remote_recipe
|
55
|
+
* server_collection
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module VagrantPlugins
|
23
|
+
module RightscaleShim
|
24
|
+
module Action
|
25
|
+
class CleanOneTimeRunlistFile
|
26
|
+
|
27
|
+
def initialize(app, env)
|
28
|
+
@app = app
|
29
|
+
end
|
30
|
+
|
31
|
+
def call(env)
|
32
|
+
one_time_runlist_file = env[:machine].config.rightscaleshim.one_time_runlist_file
|
33
|
+
|
34
|
+
if one_time_runlist_file && File.exists?(one_time_runlist_file)
|
35
|
+
FileUtils.rm one_time_runlist_file
|
36
|
+
end
|
37
|
+
|
38
|
+
@app.call(env)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module VagrantPlugins
|
23
|
+
module RightscaleShim
|
24
|
+
module Action
|
25
|
+
class Cleanup
|
26
|
+
|
27
|
+
def initialize(app, env)
|
28
|
+
@app = app
|
29
|
+
end
|
30
|
+
|
31
|
+
def call(env)
|
32
|
+
shim_dir = env[:machine].config.rightscaleshim.shim_dir
|
33
|
+
|
34
|
+
if shim_dir && File.directory?(shim_dir)
|
35
|
+
FileUtils.rm_rf shim_dir
|
36
|
+
end
|
37
|
+
|
38
|
+
@app.call(env)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module VagrantPlugins
|
23
|
+
module RightscaleShim
|
24
|
+
module Action
|
25
|
+
class ConfigChefSolo
|
26
|
+
|
27
|
+
def initialize(app, env)
|
28
|
+
@app = app
|
29
|
+
end
|
30
|
+
|
31
|
+
def call(env)
|
32
|
+
shim_dir = env[:machine].config.rightscaleshim.shim_dir
|
33
|
+
run_list_dir = env[:machine].config.rightscaleshim.run_list_dir
|
34
|
+
one_time_runlist_file = env[:machine].config.rightscaleshim.one_time_runlist_file
|
35
|
+
|
36
|
+
if shim_dir && !shim_dir.empty? && run_list_dir && !run_list_dir.empty?
|
37
|
+
node_js_file = File.join(Dir.pwd, shim_dir, 'node.js')
|
38
|
+
dispatch_dir = File.join(Dir.pwd, shim_dir, 'dispatch')
|
39
|
+
FileUtils.mkdir_p dispatch_dir unless File.directory? dispatch_dir
|
40
|
+
|
41
|
+
dispatch_files = Dir.entries(dispatch_dir).reject{|f| /^\.+/ =~ f}.sort_by{|f| File.mtime(File.join(dispatch_dir, f))}
|
42
|
+
|
43
|
+
runlist = JSON.parse(File.read(File.join(Dir.pwd, run_list_dir, 'default.json')))
|
44
|
+
|
45
|
+
if File.exist? node_js_file
|
46
|
+
runlist.merge! JSON.parse(File.read(node_js_file))["normal"]
|
47
|
+
end
|
48
|
+
|
49
|
+
# A specified runlist trumps all, but still inherits from default
|
50
|
+
if ENV['runlist']
|
51
|
+
runlist_file = File.join(Dir.pwd, run_list_dir, "#{ENV['runlist']}.json")
|
52
|
+
runlist.merge!(JSON.parse(File.read(runlist_file))) if File.exist? runlist_file
|
53
|
+
elsif dispatch_files.length > 0
|
54
|
+
dispatch_file = File.join(dispatch_dir, dispatch_files.first)
|
55
|
+
runlist.merge!(JSON.parse(File.read(dispatch_file)))
|
56
|
+
one_time_runlist_file = dispatch_file
|
57
|
+
env[:machine].config.rightscaleshim.one_time_runlist_file = dispatch_file
|
58
|
+
end
|
59
|
+
|
60
|
+
chef_solo_provisioners = env[:machine].config.vm.provisioners.select { |prov| prov.name == :chef_solo }
|
61
|
+
if chef_solo_provisioners.any?
|
62
|
+
chef_solo_provisioners.each do |solo_provisioner|
|
63
|
+
solo_provisioner.config.json = {
|
64
|
+
:rightscaleshim => {
|
65
|
+
:shim_dir => shim_dir,
|
66
|
+
:run_list_dir => run_list_dir,
|
67
|
+
:one_time_runlist_file => one_time_runlist_file
|
68
|
+
}
|
69
|
+
}.merge(runlist)
|
70
|
+
solo_provisioner.config.run_list = runlist['run_list']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
@app.call(env)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module VagrantPlugins
|
23
|
+
module RightscaleShim
|
24
|
+
module Action
|
25
|
+
class << self
|
26
|
+
def config_chef_solo
|
27
|
+
@config_chef_solo ||= ::Vagrant::Action::Builder.new.tap do |b|
|
28
|
+
b.use VagrantPlugins::RightscaleShim::Action::ConfigChefSolo
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def clean_one_time_runlist_file
|
33
|
+
@clean_one_time_runlist_file ||= ::Vagrant::Action::Builder.new.tap do |b|
|
34
|
+
b.use VagrantPlugins::RightscaleShim::Action::CleanOneTimeRunlistFile
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def cleanup
|
39
|
+
@cleanup ||= ::Vagrant::Action::Builder.new.tap do |b|
|
40
|
+
b.use VagrantPlugins::RightscaleShim::Action::Cleanup
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module VagrantPlugins
|
23
|
+
module RightscaleShim
|
24
|
+
class Config < Vagrant.plugin("2", :config)
|
25
|
+
attr_accessor :shim_dir
|
26
|
+
attr_accessor :run_list_dir
|
27
|
+
attr_accessor :one_time_runlist_file
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
super
|
31
|
+
|
32
|
+
@shim_dir = UNSET_VALUE
|
33
|
+
@run_list_dir = UNSET_VALUE
|
34
|
+
@one_time_runlist_file = UNSET_VALUE
|
35
|
+
end
|
36
|
+
|
37
|
+
def finalize!
|
38
|
+
@shim_dir = nil if @shim_dir == UNSET_VALUE
|
39
|
+
@run_list_dir = nil if @run_list_dir == UNSET_VALUE
|
40
|
+
@one_time_runlist_file = nil if @one_time_runlist_file == UNSET_VALUE
|
41
|
+
end
|
42
|
+
|
43
|
+
# TODO: Better error handling, verify shim dir and runlist dir exist, catch json errors when parsing runlists
|
44
|
+
def validate(machine)
|
45
|
+
errors = _detected_errors
|
46
|
+
if !machine.config.rightscaleshim.shim_dir || machine.config.rightscaleshim.shim_dir.empty?
|
47
|
+
errors << I18.t("vagrant.config.rightscaleshim.shim_dir_missing")
|
48
|
+
end
|
49
|
+
|
50
|
+
if !machine.config.rightscaleshim.run_list_dir || machine.config.rightscaleshim.run_list_dir.empty?
|
51
|
+
errors << I18n.t("vagrant.config.rightscaleshim.run_list_dir_missing")
|
52
|
+
end
|
53
|
+
|
54
|
+
{'rightscaleshim' => errors}
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
begin
|
23
|
+
require "vagrant"
|
24
|
+
rescue LoadError
|
25
|
+
raise "The RightscaleShim plugin must be run within Vagrant."
|
26
|
+
end
|
27
|
+
|
28
|
+
# This is a sanity check to make sure no one is attempting to install
|
29
|
+
# this into an early Vagrant version.
|
30
|
+
if Vagrant::VERSION < "1.2.0"
|
31
|
+
raise "The RightscaleShim plugin is only compatible with Vagrant 1.2+"
|
32
|
+
end
|
33
|
+
|
34
|
+
module VagrantPlugins
|
35
|
+
module RightscaleShim
|
36
|
+
class Plugin < Vagrant.plugin("2")
|
37
|
+
class << self
|
38
|
+
def provision(hook)
|
39
|
+
hook.before(::Vagrant::Action::Builtin::Provision, VagrantPlugins::RightscaleShim::Action.config_chef_solo)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
name "RightScale Vagrant Shim"
|
44
|
+
|
45
|
+
config :rightscaleshim do
|
46
|
+
require_relative 'config'
|
47
|
+
VagrantPlugins::RightscaleShim::Config
|
48
|
+
end
|
49
|
+
|
50
|
+
action_hook(:rightscaleshim_provision, :machine_action_up, &method(:provision))
|
51
|
+
action_hook(:rightscaleshim_provision, :machine_action_reload, &method(:provision))
|
52
|
+
action_hook(:rightscaleshim_provision, :machine_action_provision, &method(:provision))
|
53
|
+
|
54
|
+
action_hook(:rightscaleshim_provision_clean, :machine_action_provision) do |hook|
|
55
|
+
hook.after(::Vagrant::Action::Builtin::Provision, VagrantPlugins::RightscaleShim::Action.clean_one_time_runlist_file)
|
56
|
+
end
|
57
|
+
|
58
|
+
action_hook(:rightscaleshim_clean, :machine_action_destroy) do |hook|
|
59
|
+
hook.after(::Vagrant::Action::Builtin::GracefulHalt, VagrantPlugins::RightscaleShim::Action.cleanup)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright (c) 2013 Ryan J. Geyer
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'vagrant-rightscaleshim/plugin'
|
23
|
+
require 'vagrant-rightscaleshim/action/cleanup'
|
24
|
+
require 'vagrant-rightscaleshim/action/config_chef_solo'
|
25
|
+
require 'vagrant-rightscaleshim/action/clean_one_time_runlist_file'
|
26
|
+
require 'vagrant-rightscaleshim/action'
|
27
|
+
|
28
|
+
locales_file = File.expand_path("../locales/en.yml", File.dirname(__FILE__))
|
29
|
+
|
30
|
+
I18n.load_path << locales_file
|
data/locales/en.yml
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
en:
|
2
|
+
vagrant:
|
3
|
+
config:
|
4
|
+
rightscaleshim:
|
5
|
+
shim_dir_missing: "Must specify a directory where vagrant-rightscaleshim will use for runtime persistence for the VM"
|
6
|
+
run_list_dir_missing: "Must specify a directory where chef solo json config files (used as runlists) can be found for the VM"
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-rightscaleshim
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ryan J. Geyer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Allows RightScale ServerTemplate development to be performed primarily
|
15
|
+
within Vagrant
|
16
|
+
email: ryan.geyer@rightscale.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/vagrant-rightscaleshim/action/clean_one_time_runlist_file.rb
|
22
|
+
- lib/vagrant-rightscaleshim/action/cleanup.rb
|
23
|
+
- lib/vagrant-rightscaleshim/action/config_chef_solo.rb
|
24
|
+
- lib/vagrant-rightscaleshim/action.rb
|
25
|
+
- lib/vagrant-rightscaleshim/config.rb
|
26
|
+
- lib/vagrant-rightscaleshim/plugin.rb
|
27
|
+
- lib/vagrant-rightscaleshim.rb
|
28
|
+
- locales/en.yml
|
29
|
+
- LICENSE.txt
|
30
|
+
- README.md
|
31
|
+
homepage: https://github.com/rgeyer/vagrant-plugin-rightscaleshime
|
32
|
+
licenses:
|
33
|
+
- MIT
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
hash: 3590498104088731916
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
hash: 3590498104088731916
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.25
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: Allows RightScale ServerTemplate development to be performed primarily within
|
62
|
+
Vagrant
|
63
|
+
test_files: []
|