vagrant-rimu 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +12 -3
- data/Vagrantfile +15 -10
- data/lib/vagrant-rimu/actions/connect_to_rimu.rb +7 -3
- data/lib/vagrant-rimu/actions/create.rb +7 -1
- data/lib/vagrant-rimu/actions/is_created.rb +18 -18
- data/lib/vagrant-rimu/actions/is_stopped.rb +1 -1
- data/lib/vagrant-rimu/actions/message_action_not_supported.rb +19 -0
- data/lib/vagrant-rimu/actions/message_will_not_stop.rb +19 -0
- data/lib/vagrant-rimu/actions/modify_provision_path.rb +1 -1
- data/lib/vagrant-rimu/actions/move.rb +1 -1
- data/lib/vagrant-rimu/actions/read_ssh_info.rb +4 -3
- data/lib/vagrant-rimu/actions/read_state.rb +1 -1
- data/lib/vagrant-rimu/actions/rebuild.rb +21 -2
- data/lib/vagrant-rimu/actions/setup_user.rb +22 -19
- data/lib/vagrant-rimu/actions/ssh_utils.rb +44 -0
- data/lib/vagrant-rimu/actions/stop_instance.rb +6 -2
- data/lib/vagrant-rimu/actions/terminate_instance.rb +6 -2
- data/lib/vagrant-rimu/actions.rb +99 -85
- data/lib/vagrant-rimu/commands/abstract_command.rb +1 -1
- data/lib/vagrant-rimu/commands/rebuild.rb +6 -7
- data/lib/vagrant-rimu/commands/root.rb +1 -1
- data/lib/vagrant-rimu/config.rb +2 -2
- data/lib/vagrant-rimu/plugin.rb +1 -1
- data/lib/vagrant-rimu/provider.rb +1 -1
- data/lib/vagrant-rimu/version.rb +1 -1
- data/locales/en.yml +26 -8
- data/spec/spec_helper.rb +1 -1
- data/spec/vagrant-rimu/actions/connect_to_rimu_spec.rb +2 -1
- data/spec/vagrant-rimu/actions/create_spec.rb +4 -1
- data/spec/vagrant-rimu/actions/is_created_spec.rb +1 -1
- data/spec/vagrant-rimu/actions/is_stopped_spec.rb +2 -2
- data/spec/vagrant-rimu/actions/message_action_not_supported_spec.rb +30 -0
- data/spec/vagrant-rimu/actions/message_already_created_spec.rb +1 -4
- data/spec/vagrant-rimu/actions/message_will_not_destroy_spec.rb +1 -2
- data/spec/vagrant-rimu/actions/message_will_not_stop_spec.rb +35 -0
- data/spec/vagrant-rimu/actions/read_ssh_info_spec.rb +8 -0
- data/spec/vagrant-rimu/actions/rebuild_spec.rb +7 -1
- data/spec/vagrant-rimu/actions/stop_instance_spec.rb +4 -4
- data/spec/vagrant-rimu/commands/rebuild_spec.rb +20 -17
- data/test/Vagrantfile +3 -1
- metadata +9 -2
@@ -6,6 +6,7 @@ require 'spec_helper'
|
|
6
6
|
|
7
7
|
describe VagrantPlugins::Rimu::Actions::Rebuild do
|
8
8
|
let(:ssh) { double('ssh') }
|
9
|
+
let(:root_path) { '.' }
|
9
10
|
let(:servers) { double('servers') }
|
10
11
|
let(:machine) { double('machine') }
|
11
12
|
let(:reinstall) { double('reinstall') }
|
@@ -28,6 +29,7 @@ describe VagrantPlugins::Rimu::Actions::Rebuild do
|
|
28
29
|
config.stub(:setup?) { true }
|
29
30
|
ssh.stub(:username) { 'rimu' }
|
30
31
|
ssh.stub(:username=) { 'rimu' }
|
32
|
+
ssh.stub(:password=).with(anything)
|
31
33
|
ssh.stub(:private_key_path) { 'test/test_rimu_id_rsa' }
|
32
34
|
config.stub(:ssh) { ssh }
|
33
35
|
end
|
@@ -43,10 +45,13 @@ describe VagrantPlugins::Rimu::Actions::Rebuild do
|
|
43
45
|
servers.stub(:reinstall) { reinstall }
|
44
46
|
os.stub(:servers) { servers }
|
45
47
|
end
|
48
|
+
env.stub(:root_path) { root_path }
|
46
49
|
machine.stub(:id) { id }
|
50
|
+
machine.stub(:env) { env }
|
47
51
|
env[:machine] = machine
|
48
52
|
env[:machine].stub(:config) { config }
|
49
53
|
env[:machine].stub(:provider_config) { config }
|
54
|
+
communicate.stub(:execute).with(anything)
|
50
55
|
communicate.stub(:ready?) { true }
|
51
56
|
env[:machine].stub(:communicate) { communicate }
|
52
57
|
end
|
@@ -62,6 +67,7 @@ describe VagrantPlugins::Rimu::Actions::Rebuild do
|
|
62
67
|
context 'when vps_to_clone option is not set' do
|
63
68
|
it 'reinstall the server using instantiation_options' do
|
64
69
|
# env.stub(:interrupted) { false }
|
70
|
+
root_passwd = Digest::SHA2.new.update('foo').to_s
|
65
71
|
expect(env[:machine].provider_config).to receive(:setup?)
|
66
72
|
expect(env[:machine].communicate).to receive(:ready?)
|
67
73
|
expect(env[:machine].config.ssh).to receive(:username=).with(ssh.username)
|
@@ -70,7 +76,7 @@ describe VagrantPlugins::Rimu::Actions::Rebuild do
|
|
70
76
|
{
|
71
77
|
:instantiation_options=> {
|
72
78
|
:domain_name=>config.host_name,
|
73
|
-
:password=>
|
79
|
+
:password=>root_passwd,
|
74
80
|
:distro=>nil,
|
75
81
|
:control_panel=>nil
|
76
82
|
},
|
@@ -33,9 +33,9 @@ describe VagrantPlugins::Rimu::Actions::StopInstance do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
describe 'call' do
|
36
|
-
context 'when server state id is not :
|
36
|
+
context 'when server state id is not :off' do
|
37
37
|
it 'stops the server' do
|
38
|
-
state.stub(:id) { :
|
38
|
+
state.stub(:id) { :active }
|
39
39
|
env[:machine].stub(:state) { state }
|
40
40
|
expect(env[:rimu_api].servers).to receive(:shutdown).with(id.to_i)
|
41
41
|
expect(app).to receive(:call)
|
@@ -43,9 +43,9 @@ describe VagrantPlugins::Rimu::Actions::StopInstance do
|
|
43
43
|
@action.call(env)
|
44
44
|
end
|
45
45
|
end
|
46
|
-
context 'when server id is :
|
46
|
+
context 'when server id is :off' do
|
47
47
|
it 'does nothing' do
|
48
|
-
state.stub(:id) { :
|
48
|
+
state.stub(:id) { :off }
|
49
49
|
env[:machine].stub(:state) { state }
|
50
50
|
expect(env[:rimu_api].servers).to_not receive(:shutdown)
|
51
51
|
expect(app).to receive(:call)
|
@@ -1,21 +1,24 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe VagrantPlugins::Rimu::Commands::Rebuild do
|
4
|
-
let(:machine) { double('machine') }
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
# let(:machine) { double('machine') }
|
5
|
+
# let(:root_path) { '.' }
|
6
|
+
#
|
7
|
+
# let(:env) do
|
8
|
+
# {}.tap do |env|
|
9
|
+
# env.stub(:root_path) { root_path }
|
10
|
+
# machine.stub(:action).with('rebuild') { 1 }
|
11
|
+
# machine.stub(:env) { env }
|
12
|
+
# env[:machine] = machine
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# before :each do
|
17
|
+
# @rebuild_cmd = VagrantPlugins::Rimu::Commands::Rebuild.new(nil, env)
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# it 'calls the machine rebuild action' do
|
21
|
+
# env[:machine].should_receive(:action).with('rebuild')
|
22
|
+
# @rebuild_cmd.execute()
|
23
|
+
# end
|
21
24
|
end
|
data/test/Vagrantfile
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
REQUIRED_PLUGINS = %w(vagrant-rimu)
|
2
|
+
abort "Please set the environment variable RIMU_API_KEY in order to run vagrant with the rimu provider" unless ENV.key? 'RIMU_API_KEY'
|
2
3
|
|
3
4
|
Vagrant.configure('2') do |config|
|
4
5
|
config.ssh.username = 'tester'
|
6
|
+
config.ssh.insert_key = true
|
5
7
|
config.ssh.private_key_path = 'test_rimu_id_rsa'
|
6
8
|
|
7
9
|
config.vm.synced_folder '.', '/vagrant', :disabled => true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-rimu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Colin Kissa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rimu
|
@@ -153,10 +153,12 @@ files:
|
|
153
153
|
- lib/vagrant-rimu/actions/is_stopped.rb
|
154
154
|
- lib/vagrant-rimu/actions/list_distributions.rb
|
155
155
|
- lib/vagrant-rimu/actions/list_servers.rb
|
156
|
+
- lib/vagrant-rimu/actions/message_action_not_supported.rb
|
156
157
|
- lib/vagrant-rimu/actions/message_already_created.rb
|
157
158
|
- lib/vagrant-rimu/actions/message_already_off.rb
|
158
159
|
- lib/vagrant-rimu/actions/message_not_created.rb
|
159
160
|
- lib/vagrant-rimu/actions/message_will_not_destroy.rb
|
161
|
+
- lib/vagrant-rimu/actions/message_will_not_stop.rb
|
160
162
|
- lib/vagrant-rimu/actions/modify_provision_path.rb
|
161
163
|
- lib/vagrant-rimu/actions/move.rb
|
162
164
|
- lib/vagrant-rimu/actions/read_ssh_info.rb
|
@@ -165,6 +167,7 @@ files:
|
|
165
167
|
- lib/vagrant-rimu/actions/reload.rb
|
166
168
|
- lib/vagrant-rimu/actions/setup_sudo.rb
|
167
169
|
- lib/vagrant-rimu/actions/setup_user.rb
|
170
|
+
- lib/vagrant-rimu/actions/ssh_utils.rb
|
168
171
|
- lib/vagrant-rimu/actions/start_instance.rb
|
169
172
|
- lib/vagrant-rimu/actions/stop_instance.rb
|
170
173
|
- lib/vagrant-rimu/actions/terminate_instance.rb
|
@@ -192,10 +195,12 @@ files:
|
|
192
195
|
- spec/vagrant-rimu/actions/is_stopped_spec.rb
|
193
196
|
- spec/vagrant-rimu/actions/list_distributions_spec.rb
|
194
197
|
- spec/vagrant-rimu/actions/list_servers_spec.rb
|
198
|
+
- spec/vagrant-rimu/actions/message_action_not_supported_spec.rb
|
195
199
|
- spec/vagrant-rimu/actions/message_already_created_spec.rb
|
196
200
|
- spec/vagrant-rimu/actions/message_already_off_spec.rb
|
197
201
|
- spec/vagrant-rimu/actions/message_not_created_spec.rb
|
198
202
|
- spec/vagrant-rimu/actions/message_will_not_destroy_spec.rb
|
203
|
+
- spec/vagrant-rimu/actions/message_will_not_stop_spec.rb
|
199
204
|
- spec/vagrant-rimu/actions/modify_provision_path_spec.rb
|
200
205
|
- spec/vagrant-rimu/actions/move_spec.rb
|
201
206
|
- spec/vagrant-rimu/actions/read_ssh_info_spec.rb
|
@@ -255,10 +260,12 @@ test_files:
|
|
255
260
|
- spec/vagrant-rimu/actions/is_stopped_spec.rb
|
256
261
|
- spec/vagrant-rimu/actions/list_distributions_spec.rb
|
257
262
|
- spec/vagrant-rimu/actions/list_servers_spec.rb
|
263
|
+
- spec/vagrant-rimu/actions/message_action_not_supported_spec.rb
|
258
264
|
- spec/vagrant-rimu/actions/message_already_created_spec.rb
|
259
265
|
- spec/vagrant-rimu/actions/message_already_off_spec.rb
|
260
266
|
- spec/vagrant-rimu/actions/message_not_created_spec.rb
|
261
267
|
- spec/vagrant-rimu/actions/message_will_not_destroy_spec.rb
|
268
|
+
- spec/vagrant-rimu/actions/message_will_not_stop_spec.rb
|
262
269
|
- spec/vagrant-rimu/actions/modify_provision_path_spec.rb
|
263
270
|
- spec/vagrant-rimu/actions/move_spec.rb
|
264
271
|
- spec/vagrant-rimu/actions/read_ssh_info_spec.rb
|