vagrant-shell 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vagrant-shell/action/run_instance.rb +4 -3
- data/lib/vagrant-shell/config.rb +14 -5
- data/lib/vagrant-shell/version.rb +1 -1
- data/locales/en.yml +2 -2
- metadata +2 -2
@@ -23,16 +23,17 @@ module VagrantPlugins
|
|
23
23
|
|
24
24
|
# Get the configs
|
25
25
|
provider_config = env[:machine].provider_config
|
26
|
-
|
26
|
+
image = provider_config.image
|
27
27
|
user_data = provider_config.user_data
|
28
|
+
run_args = provider_config.run_args
|
28
29
|
|
29
30
|
# Launch!
|
30
31
|
env[:ui].info(I18n.t("vagrant_shell.launching_instance"))
|
31
|
-
env[:ui].info(" --
|
32
|
+
env[:ui].info(" -- Image: #{image}")
|
32
33
|
|
33
34
|
begin
|
34
35
|
# Immediately save the ID since it is created at this point.
|
35
|
-
env[:machine].id = `#{env[:machine].provider_config.script} run-instance #{
|
36
|
+
env[:machine].id = `#{env[:machine].provider_config.script} run-instance #{image} #{run_args.join(" ")}`.split(/\s+/)[0]
|
36
37
|
rescue Errors::ComputeError => e
|
37
38
|
raise Errors::ShellError, :message => e.message
|
38
39
|
end
|
data/lib/vagrant-shell/config.rb
CHANGED
@@ -3,10 +3,10 @@ require "vagrant"
|
|
3
3
|
module VagrantPlugins
|
4
4
|
module Shell
|
5
5
|
class Config < Vagrant.plugin("2", :config)
|
6
|
-
# The ID of the
|
6
|
+
# The ID of the Image to use.
|
7
7
|
#
|
8
8
|
# @return [String]
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :image
|
10
10
|
|
11
11
|
# The timeout to wait for an instance to become ready.
|
12
12
|
#
|
@@ -23,11 +23,17 @@ module VagrantPlugins
|
|
23
23
|
# @return [String]
|
24
24
|
attr_accessor :script
|
25
25
|
|
26
|
+
# The shell script run-instance args
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :run_args
|
30
|
+
|
26
31
|
def initialize
|
27
|
-
@
|
32
|
+
@image = UNSET_VALUE
|
28
33
|
@instance_ready_timeout = UNSET_VALUE
|
29
34
|
@user_data = UNSET_VALUE
|
30
35
|
@script = UNSET_VALUE
|
36
|
+
@run_args = UNSET_VALUE
|
31
37
|
|
32
38
|
# Internal state (prefix with __ so they aren't automatically
|
33
39
|
# merged)
|
@@ -44,8 +50,8 @@ module VagrantPlugins
|
|
44
50
|
end
|
45
51
|
|
46
52
|
def finalize!
|
47
|
-
#
|
48
|
-
@
|
53
|
+
# Image must be nil, since we can't default that
|
54
|
+
@image = nil if @image == UNSET_VALUE
|
49
55
|
|
50
56
|
# Set the default timeout for waiting for an instance to be ready
|
51
57
|
@instance_ready_timeout = 120 if @instance_ready_timeout == UNSET_VALUE
|
@@ -56,6 +62,9 @@ module VagrantPlugins
|
|
56
62
|
# No default shell script
|
57
63
|
@script = nil if @script == UNSET_VALUE
|
58
64
|
|
65
|
+
# No rub args by default
|
66
|
+
@run_args = [] if @run_args == UNSET_VALUE
|
67
|
+
|
59
68
|
# Mark that we finalized
|
60
69
|
@__finalized = true
|
61
70
|
end
|
data/locales/en.yml
CHANGED
@@ -22,8 +22,8 @@ en:
|
|
22
22
|
will be silently ignored.
|
23
23
|
|
24
24
|
config:
|
25
|
-
|
26
|
-
An
|
25
|
+
image_required: |-
|
26
|
+
An Image must be configured via "image"
|
27
27
|
private_key_missing: |-
|
28
28
|
The specified private key for Shell could not be found
|
29
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Enables Vagrant to manage machines using shell scripts
|
16
16
|
email:
|