vagrant-rimu 0.0.2 → 0.0.7
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 +5 -5
- data/.codeclimate.yml +3 -2
- data/.gitignore +2 -0
- data/.travis.yml +5 -35
- data/Gemfile +4 -2
- data/README.md +13 -4
- data/Rakefile +6 -3
- data/Vagrantfile +5 -0
- data/gemfiles/vagrant_1.5.gemfile +3 -1
- data/gemfiles/vagrant_1.6.gemfile +5 -3
- data/gemfiles/vagrant_1.7.gemfile +10 -8
- data/lib/vagrant-rimu/actions.rb +102 -80
- data/lib/vagrant-rimu/actions/abstract_action.rb +20 -0
- data/lib/vagrant-rimu/actions/billing_methods.rb +11 -4
- data/lib/vagrant-rimu/actions/connect_to_rimu.rb +12 -6
- data/lib/vagrant-rimu/actions/create.rb +24 -5
- data/lib/vagrant-rimu/actions/is_created.rb +4 -2
- data/lib/vagrant-rimu/actions/is_stopped.rb +5 -3
- data/lib/vagrant-rimu/actions/list_distributions.rb +11 -4
- data/lib/vagrant-rimu/actions/list_servers.rb +11 -6
- data/lib/vagrant-rimu/actions/message_action_not_supported.rb +19 -0
- data/lib/vagrant-rimu/actions/message_already_created.rb +4 -2
- data/lib/vagrant-rimu/actions/message_already_off.rb +4 -2
- data/lib/vagrant-rimu/actions/message_not_created.rb +4 -2
- data/lib/vagrant-rimu/actions/message_will_not_destroy.rb +4 -2
- data/lib/vagrant-rimu/actions/message_will_not_stop.rb +19 -0
- data/lib/vagrant-rimu/actions/modify_provision_path.rb +5 -3
- data/lib/vagrant-rimu/actions/move.rb +31 -4
- data/lib/vagrant-rimu/actions/read_ssh_info.rb +8 -5
- data/lib/vagrant-rimu/actions/read_state.rb +12 -4
- data/lib/vagrant-rimu/actions/rebuild.rb +33 -5
- data/lib/vagrant-rimu/actions/reload.rb +10 -3
- data/lib/vagrant-rimu/actions/setup_sudo.rb +15 -8
- data/lib/vagrant-rimu/actions/setup_user.rb +44 -30
- data/lib/vagrant-rimu/actions/ssh_utils.rb +44 -0
- data/lib/vagrant-rimu/actions/start_instance.rb +4 -2
- data/lib/vagrant-rimu/actions/stop_instance.rb +16 -6
- data/lib/vagrant-rimu/actions/terminate_instance.rb +10 -4
- data/lib/vagrant-rimu/commands/abstract_command.rb +47 -0
- data/lib/vagrant-rimu/commands/billing_methods.rb +10 -10
- data/lib/vagrant-rimu/commands/distributions.rb +10 -10
- data/lib/vagrant-rimu/commands/list_servers.rb +10 -10
- data/lib/vagrant-rimu/commands/move.rb +10 -10
- data/lib/vagrant-rimu/commands/rebuild.rb +5 -7
- data/lib/vagrant-rimu/commands/rimu_command.rb +13 -0
- data/lib/vagrant-rimu/commands/root.rb +26 -43
- data/lib/vagrant-rimu/commands/utils.rb +22 -0
- data/lib/vagrant-rimu/config.rb +3 -2
- data/lib/vagrant-rimu/errors.rb +4 -0
- 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 +70 -19
- data/spec/spec_helper.rb +1 -1
- data/spec/vagrant-rimu/actions/billing_methods_spec.rb +4 -4
- data/spec/vagrant-rimu/actions/connect_to_rimu_spec.rb +2 -1
- data/spec/vagrant-rimu/actions/create_spec.rb +167 -0
- 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/list_distributions_spec.rb +4 -4
- data/spec/vagrant-rimu/actions/list_servers_spec.rb +4 -4
- 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/move_spec.rb +75 -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/billing_methods_spec.rb +17 -0
- data/spec/vagrant-rimu/commands/distributions_spec.rb +17 -0
- data/spec/vagrant-rimu/commands/list_servers_spec.rb +17 -0
- data/spec/vagrant-rimu/commands/move_spec.rb +17 -0
- data/spec/vagrant-rimu/commands/rebuild_spec.rb +20 -0
- data/test/Vagrantfile +4 -2
- data/vagrant-rimu.gemspec +3 -1
- metadata +48 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e8c8a45ff2b1a17a1323cc00e212cfba14653ab13d2d05b4356fa7b37fc41480
|
4
|
+
data.tar.gz: 0b257975019a8eb389ad597284643c5ad98fea6522aa4c7df5e5ad4f1eff9375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a0632b72d23a0e1659af6d515b7abd8bb6169448a71d8221a3e92d45e186e2d8a4b28cee87d3857891836c45114a6e3680e98b22d9ee805c414ac945196098
|
7
|
+
data.tar.gz: c3fdda36ee19e43489e0d00d19810bda0d267041491920f85b6f26ecfc14b396c85170f9889d6db467db324fd028dd0ccdcc8d3dc03a64d76e2f8d72c9aeb02a
|
data/.codeclimate.yml
CHANGED
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,51 +1,21 @@
|
|
1
1
|
language: ruby
|
2
|
-
script: bundle exec
|
2
|
+
script: bundle exec rake
|
3
3
|
before_install:
|
4
4
|
- rvm @global do gem uninstall bundler --all --force --executables
|
5
5
|
- gem uninstall bundler --all --force --executables
|
6
6
|
- gem install bundler -v "$BUNDLER_VERSION"
|
7
7
|
# bundler_args: --without development
|
8
|
+
install:
|
9
|
+
- travis_retry bundle install
|
8
10
|
addons:
|
9
11
|
code_climate:
|
10
12
|
repo_token: 3a5d0d815b7e9bc2c6b4608f74babd935d43fa564cd9041944dfd221f593a4db
|
11
13
|
matrix:
|
12
14
|
include:
|
13
15
|
- gemfile: Gemfile
|
14
|
-
rvm: 2.
|
16
|
+
rvm: 2.3.0
|
15
17
|
env:
|
16
|
-
BUNDLER_VERSION='
|
17
|
-
- gemfile: Gemfile
|
18
|
-
rvm: 2.1.4
|
19
|
-
env:
|
20
|
-
BUNDLER_VERSION='>= 1.5.2, < 1.8.0'
|
21
|
-
- gemfile: Gemfile
|
22
|
-
rvm: 2.0.0
|
23
|
-
env:
|
24
|
-
BUNDLER_VERSION='>= 1.5.2, < 1.8.0'
|
25
|
-
- gemfile: gemfiles/vagrant_1.6.gemfile
|
26
|
-
rvm: 2.2.1
|
27
|
-
env:
|
28
|
-
BUNDLER_VERSION='>= 1.5.2, < 1.7.0'
|
29
|
-
- gemfile: gemfiles/vagrant_1.6.gemfile
|
30
|
-
rvm: 2.1.4
|
31
|
-
env:
|
32
|
-
BUNDLER_VERSION='>= 1.5.2, < 1.7.0'
|
33
|
-
- gemfile: gemfiles/vagrant_1.6.gemfile
|
34
|
-
rvm: 2.0.0
|
35
|
-
env:
|
36
|
-
BUNDLER_VERSION='>= 1.5.2, < 1.7.0'
|
37
|
-
# - gemfile: gemfiles/vagrant_1.5.gemfile
|
38
|
-
# rvm: 2.2.1
|
39
|
-
# env:
|
40
|
-
# BUNDLER_VERSION='= 1.5.2'
|
41
|
-
- gemfile: gemfiles/vagrant_1.5.gemfile
|
42
|
-
rvm: 2.1.4
|
43
|
-
env:
|
44
|
-
BUNDLER_VERSION='= 1.5.2'
|
45
|
-
- gemfile: gemfiles/vagrant_1.5.gemfile
|
46
|
-
rvm: 2.0.0
|
47
|
-
env:
|
48
|
-
BUNDLER_VERSION='= 1.5.2'
|
18
|
+
BUNDLER_VERSION='1.7.9'
|
49
19
|
|
50
20
|
notifications:
|
51
21
|
email:
|
data/Gemfile
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
+
gemspec
|
4
|
+
|
3
5
|
group :test do
|
4
6
|
gem 'codecov', :require => false
|
5
7
|
gem 'simplecov', :require => false
|
@@ -14,10 +16,10 @@ group :development do
|
|
14
16
|
else
|
15
17
|
gem 'vagrant', :git => 'https://github.com/mitchellh/vagrant.git'
|
16
18
|
end
|
19
|
+
gem 'rubocop', '~> 0.49.0', :require => false
|
17
20
|
end
|
18
21
|
|
19
22
|
group :plugins do
|
20
|
-
gem 'bundler', '
|
23
|
+
gem 'bundler', '1.7.9'
|
21
24
|
gem 'vagrant-rimu', :path => '.'
|
22
|
-
gemspec
|
23
25
|
end
|
data/README.md
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
management of [Rimuhosting](https://www.rimuhosting.com/) VPS's.
|
5
5
|
|
6
6
|
[](https://travis-ci.org/akissa/vagrant-rimu)
|
7
|
-
[](https://codecov.io/github/akissa/vagrant-rimu?branch=master)
|
8
7
|
[](https://codeclimate.com/github/akissa/vagrant-rimu)
|
9
8
|
[](https://codeclimate.com/github/akissa/vagrant-rimu/coverage)
|
9
|
+
[](https://badge.fury.io/rb/vagrant-rimu)
|
10
10
|
[](https://www.mozilla.org/MPL/2.0/)
|
11
11
|
|
12
12
|
Current Features include:
|
@@ -35,7 +35,8 @@ The most basic `Vagrantfile` to create a VPS on Rimu is shown below
|
|
35
35
|
```ruby
|
36
36
|
Vagrant.configure('2') do |config|
|
37
37
|
|
38
|
-
config.vm.provider :rimu do |provider|
|
38
|
+
config.vm.provider :rimu do |provider, override|
|
39
|
+
override.ssh.insert_key = true
|
39
40
|
override.ssh.private_key_path = '~/.ssh/id_rsa'
|
40
41
|
|
41
42
|
provider.api_key = 'YOUR RIMU API KEY'
|
@@ -91,8 +92,16 @@ The provider supports the following Vagrant sub-commands:
|
|
91
92
|
- `vagrant status` - Outputs the status (active, off, not created) for the
|
92
93
|
Rimu VPS.
|
93
94
|
- `vagrant ssh` - Logs into the Rimu VPS using the configured user account.
|
94
|
-
- `vagrant rimu` -
|
95
|
-
|
95
|
+
- `vagrant rimu` - Rimu provider specific commands
|
96
|
+
|
97
|
+
**Rimu Specific Commands**
|
98
|
+
|
99
|
+
The Rimu specific commands are available as sub commands of `vagrant rimu`.
|
100
|
+
The `vagrant rimu` command provides the following sub commands:
|
101
|
+
- `distributions` - Lists the distributions supported.
|
102
|
+
- `servers` - Lists the servers under your account.
|
103
|
+
- `billing methods` - Lists the billing methods setup for your account.
|
104
|
+
- `move-vps` - Moves your VPS to a different host.
|
96
105
|
|
97
106
|
## Contributing
|
98
107
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rubocop/rake_task'
|
3
4
|
|
4
5
|
RSpec::Core::RakeTask.new(:spec)
|
5
6
|
|
6
|
-
|
7
|
+
RuboCop::RakeTask.new
|
8
|
+
|
9
|
+
task default: %w(rubocop spec)
|
data/Vagrantfile
CHANGED
@@ -1,10 +1,15 @@
|
|
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|
|
5
|
+
config.ssh.insert_key = true
|
6
|
+
config.vm.synced_folder '.', '/vagrant', :disabled => true
|
4
7
|
config.vm.provider :rimu do |provider, override|
|
5
8
|
override.ssh.private_key_path = 'test/test_rimu_id_rsa'
|
9
|
+
override.ssh.insert_key = true
|
6
10
|
provider.api_key = ENV['RIMU_API_KEY']
|
7
11
|
provider.host_name = 'rimu.example.com'
|
12
|
+
provider.disk_space_mb = 4000
|
8
13
|
end
|
9
14
|
config.vm.provision "shell", inline: "echo 'done' > ~/provision"
|
10
15
|
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
+
gemspec :path => '../'
|
4
|
+
|
3
5
|
group :development do
|
4
6
|
gem 'vagrant', :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.5.4'
|
7
|
+
gem 'rubocop', '~> 0.29.0', :require => false
|
5
8
|
end
|
6
9
|
|
7
10
|
group :test do
|
@@ -14,5 +17,4 @@ end
|
|
14
17
|
group :plugins do
|
15
18
|
gem 'bundler', '= 1.5.2'
|
16
19
|
gem 'vagrant-rimu', :path => '../'
|
17
|
-
gemspec :path => '../'
|
18
20
|
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
gemspec :path => '../'
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
gem 'vagrant', :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.6.5'
|
7
|
+
gem 'rubocop', '~> 0.29.0', :require => false
|
5
8
|
end
|
6
9
|
|
7
10
|
group :test do
|
@@ -14,5 +17,4 @@ end
|
|
14
17
|
group :plugins do
|
15
18
|
gem 'bundler', '>= 1.5.2', '< 1.7.0'
|
16
19
|
gem 'vagrant-rimu', :path => '../'
|
17
|
-
gemspec :path => '../'
|
18
20
|
end
|
@@ -1,18 +1,20 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
+
gemspec :path => '../'
|
4
|
+
|
3
5
|
group :development do
|
4
|
-
|
6
|
+
gem 'vagrant', :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.7.1'
|
7
|
+
gem 'rubocop', '~> 0.29.0', :require => false
|
5
8
|
end
|
6
9
|
|
7
10
|
group :test do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
gem 'codecov', :require => false
|
12
|
+
gem 'simplecov', :require => false
|
13
|
+
gem 'coveralls', :require => false
|
14
|
+
gem 'codeclimate-test-reporter', require: false
|
12
15
|
end
|
13
16
|
|
14
17
|
group :plugins do
|
15
|
-
|
16
|
-
|
17
|
-
gemspec :path => '../'
|
18
|
+
gem 'bundler', '>= 1.5.2', '< 1.8.0'
|
19
|
+
gem 'vagrant-rimu', :path => '../'
|
18
20
|
end
|
data/lib/vagrant-rimu/actions.rb
CHANGED
@@ -4,25 +4,26 @@ require 'vagrant/action/builder'
|
|
4
4
|
|
5
5
|
module VagrantPlugins
|
6
6
|
module Rimu
|
7
|
+
# rubocop:disable Metrics/ModuleLength
|
7
8
|
module Actions
|
8
9
|
include Vagrant::Action::Builtin
|
9
10
|
|
10
11
|
# This action is called to terminate the remote machine.
|
11
12
|
def self.action_destroy
|
12
13
|
new_builder.tap do |b|
|
13
|
-
b.use Call, DestroyConfirm do |env,
|
14
|
+
b.use Call, DestroyConfirm do |env, b1|
|
14
15
|
if env[:result]
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
b1.use ConfigValidate
|
17
|
+
b1.use ConnectToRimu
|
18
|
+
b1.use Call, ReadState do |env1, b2|
|
19
|
+
if env1[:machine_state] == :not_created
|
20
|
+
b2.use MessageNotCreated
|
21
|
+
else
|
22
|
+
b2.use TerminateInstance
|
20
23
|
end
|
21
24
|
end
|
22
|
-
b2.use ConnectToRimu
|
23
|
-
b2.use TerminateInstance
|
24
25
|
else
|
25
|
-
|
26
|
+
b1.use MessageWillNotDestroy
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -40,7 +41,7 @@ module VagrantPlugins
|
|
40
41
|
end
|
41
42
|
|
42
43
|
# This action is called to read the state of the machine. The
|
43
|
-
# resulting state is expected to be put into the `:
|
44
|
+
# resulting state is expected to be put into the `:machine_state`
|
44
45
|
# key.
|
45
46
|
def self.action_read_state
|
46
47
|
new_builder.tap do |b|
|
@@ -54,13 +55,13 @@ module VagrantPlugins
|
|
54
55
|
def self.action_ssh
|
55
56
|
new_builder.tap do |b|
|
56
57
|
b.use ConfigValidate
|
57
|
-
b.use
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
b.use ConnectToRimu
|
59
|
+
b.use Call, ReadState do |env, b1|
|
60
|
+
if env[:machine_state] == :not_created
|
61
|
+
b1.use MessageNotCreated
|
62
|
+
else
|
63
|
+
b1.use SSHExec
|
61
64
|
end
|
62
|
-
|
63
|
-
b2.use SSHExec
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|
@@ -68,53 +69,53 @@ module VagrantPlugins
|
|
68
69
|
def self.action_ssh_run
|
69
70
|
new_builder.tap do |b|
|
70
71
|
b.use ConfigValidate
|
71
|
-
b.use
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
b.use ConnectToRimu
|
73
|
+
b.use Call, ReadState do |env, b1|
|
74
|
+
if env[:machine_state] == :not_created
|
75
|
+
b1.use MessageNotCreated
|
76
|
+
else
|
77
|
+
b1.use SSHRun
|
75
78
|
end
|
76
|
-
|
77
|
-
b2.use SSHRun
|
78
79
|
end
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|
82
83
|
# This action is called when `vagrant provision` is called.
|
83
84
|
def self.action_provision
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
new_builder.tap do |b|
|
86
|
+
b.use ConfigValidate
|
87
|
+
b.use ConnectToRimu
|
88
|
+
b.use Call, ReadState do |env, b1|
|
88
89
|
case env[:machine_state]
|
89
90
|
when :active
|
90
|
-
|
91
|
-
|
92
|
-
|
91
|
+
b1.use Provision
|
92
|
+
b1.use ModifyProvisionPath
|
93
|
+
b1.use SyncedFolders
|
93
94
|
when :off
|
94
95
|
env[:ui].info I18n.t('vagrant_rimu.off')
|
95
96
|
when :not_created
|
96
|
-
|
97
|
+
b1.use MessageNotCreated
|
97
98
|
end
|
98
99
|
end
|
99
100
|
end
|
100
101
|
end
|
101
102
|
|
102
103
|
def self.action_up
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
new_builder.tap do |b|
|
105
|
+
b.use ConfigValidate
|
106
|
+
b.use ConnectToRimu
|
107
|
+
b.use Call, ReadState do |env, b1|
|
107
108
|
case env[:machine_state]
|
108
|
-
when :active
|
109
|
-
b.use MessageAlreadyCreated
|
110
|
-
when :off
|
111
|
-
b.use StartInstance
|
112
|
-
b.use action_provision
|
113
109
|
when :not_created
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
b1.use Create
|
111
|
+
b1.use SetupSudo
|
112
|
+
b1.use SetupUser
|
113
|
+
b1.use action_provision
|
114
|
+
when :off
|
115
|
+
b1.use StartInstance
|
116
|
+
b1.use action_provision
|
117
|
+
else
|
118
|
+
b1.use MessageAlreadyCreated
|
118
119
|
end
|
119
120
|
end
|
120
121
|
end
|
@@ -122,56 +123,54 @@ module VagrantPlugins
|
|
122
123
|
|
123
124
|
# This action is called to halt the remote machine.
|
124
125
|
def self.action_halt
|
125
|
-
new_builder.tap do |
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
end
|
140
|
-
end
|
126
|
+
new_builder.tap do |b|
|
127
|
+
b.use MessageWillNotStop
|
128
|
+
# b.use ConfigValidate
|
129
|
+
# b.use ConnectToRimu
|
130
|
+
# b.use Call, ReadState do |env, b1|
|
131
|
+
# case env[:machine_state]
|
132
|
+
# when :not_created
|
133
|
+
# b1.use MessageNotCreated
|
134
|
+
# when :off
|
135
|
+
# b1.use MessageAlreadyOff
|
136
|
+
# else
|
137
|
+
# b1.use StopInstance
|
138
|
+
# end
|
139
|
+
# end
|
141
140
|
end
|
142
141
|
end
|
143
142
|
|
144
143
|
def self.action_reload
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
144
|
+
new_builder.tap do |b|
|
145
|
+
b.use ConfigValidate
|
146
|
+
b.use ConnectToRimu
|
147
|
+
b.use Call, ReadState do |env, b1|
|
149
148
|
case env[:machine_state]
|
150
|
-
when :
|
151
|
-
|
152
|
-
b.use action_provision
|
149
|
+
when :not_created
|
150
|
+
b1.use MessageNotCreated
|
153
151
|
when :off
|
154
152
|
env[:ui].info I18n.t('vagrant_rimu.off')
|
155
|
-
|
156
|
-
|
153
|
+
else
|
154
|
+
b1.use Reload
|
155
|
+
b1.use action_provision
|
157
156
|
end
|
158
157
|
end
|
159
158
|
end
|
160
159
|
end
|
161
160
|
|
162
161
|
def self.action_rebuild
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
162
|
+
new_builder.tap do |b|
|
163
|
+
b.use ConfigValidate
|
164
|
+
b.use ConnectToRimu
|
165
|
+
b.use Call, ReadState do |env, b1|
|
167
166
|
case env[:machine_state]
|
168
167
|
when :active, :off
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
168
|
+
b1.use Rebuild
|
169
|
+
b1.use SetupSudo
|
170
|
+
b1.use SetupUser
|
171
|
+
b1.use action_provision
|
173
172
|
when :not_created
|
174
|
-
|
173
|
+
b1.use MessageNotCreated
|
175
174
|
end
|
176
175
|
end
|
177
176
|
end
|
@@ -205,7 +204,28 @@ module VagrantPlugins
|
|
205
204
|
new_builder.tap do |b|
|
206
205
|
b.use ConfigValidate
|
207
206
|
b.use ConnectToRimu
|
208
|
-
b.use
|
207
|
+
b.use Call, ReadState do |env, b1|
|
208
|
+
case env[:machine_state]
|
209
|
+
when :active, :off
|
210
|
+
b1.use Move
|
211
|
+
when :not_created
|
212
|
+
b1.use MessageNotCreated
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
def self.action_suspend
|
219
|
+
new_builder.tap do |b|
|
220
|
+
b.use ConfigValidate
|
221
|
+
b.use MessageActionNotSupported
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
def self.action_resume
|
226
|
+
new_builder.tap do |b|
|
227
|
+
b.use ConfigValidate
|
228
|
+
b.use MessageActionNotSupported
|
209
229
|
end
|
210
230
|
end
|
211
231
|
|
@@ -213,8 +233,8 @@ module VagrantPlugins
|
|
213
233
|
autoload :ConnectToRimu, action_root.join('connect_to_rimu')
|
214
234
|
autoload :StopInstance, action_root.join('stop_instance')
|
215
235
|
autoload :TerminateInstance, action_root.join('terminate_instance')
|
216
|
-
autoload :IsCreated, action_root.join('is_created')
|
217
|
-
autoload :IsStopped, action_root.join('is_stopped')
|
236
|
+
# autoload :IsCreated, action_root.join('is_created')
|
237
|
+
# autoload :IsStopped, action_root.join('is_stopped')
|
218
238
|
autoload :ReadSSHInfo, action_root.join('read_ssh_info')
|
219
239
|
autoload :ReadState, action_root.join('read_state')
|
220
240
|
autoload :StartInstance, action_root.join('start_instance')
|
@@ -232,6 +252,8 @@ module VagrantPlugins
|
|
232
252
|
autoload :MessageNotCreated, action_root.join('message_not_created')
|
233
253
|
autoload :MessageWillNotDestroy, action_root.join('message_will_not_destroy')
|
234
254
|
autoload :MessageAlreadyCreated, action_root.join('message_already_created')
|
255
|
+
autoload :MessageWillNotStop, action_root.join('message_will_not_stop')
|
256
|
+
autoload :MessageActionNotSupported, action_root.join('message_action_not_supported')
|
235
257
|
|
236
258
|
private
|
237
259
|
|