vagrant_abiquo 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +149 -0
- data/LICENSE.txt +22 -0
- data/README.md +100 -0
- data/Rakefile +22 -0
- data/Vagrantfile +39 -0
- data/box/abiquo.box +0 -0
- data/box/metadata.json +3 -0
- data/lib/vagrant_abiquo.rb +18 -0
- data/lib/vagrant_abiquo/actions.rb +133 -0
- data/lib/vagrant_abiquo/actions/check_state.rb +24 -0
- data/lib/vagrant_abiquo/actions/create.rb +120 -0
- data/lib/vagrant_abiquo/actions/create_vapp.rb +38 -0
- data/lib/vagrant_abiquo/actions/destroy.rb +46 -0
- data/lib/vagrant_abiquo/actions/power_off.rb +30 -0
- data/lib/vagrant_abiquo/actions/power_on.rb +30 -0
- data/lib/vagrant_abiquo/actions/reset.rb +37 -0
- data/lib/vagrant_abiquo/config.rb +55 -0
- data/lib/vagrant_abiquo/errors.rb +45 -0
- data/lib/vagrant_abiquo/helpers/abiquo.rb +173 -0
- data/lib/vagrant_abiquo/helpers/client.rb +15 -0
- data/lib/vagrant_abiquo/helpers/result.rb +40 -0
- data/lib/vagrant_abiquo/plugin.rb +26 -0
- data/lib/vagrant_abiquo/provider.rb +67 -0
- data/lib/vagrant_abiquo/version.rb +5 -0
- data/locales/en.yml +111 -0
- data/test/Vagrantfile +25 -0
- data/test/scripts/provision.sh +3 -0
- data/test/test.sh +9 -0
- data/vagrant_abiquo.gemspec +20 -0
- metadata +110 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c8ec55eea899018a9da753f534037fbd7ccec64d
|
4
|
+
data.tar.gz: 8c42327a3c29996bc27f2b4dc3825254e6bdc7d7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 736b5dd04c0de34fe64583503df1ea0c4dfddab3b9e3a253a271e8131fdd7cc5c1f8bef0d92d0445f4c094e0da5df95878be6f68db6d35ed5d833fc50450f0e7
|
7
|
+
data.tar.gz: 1bfd63dc9f1e3049f068af76805ad4786777f9fa6f531bc082364f4c2240f8aa70b4349b06374f15689a047f7e73c6a14c642fabfa2ef293e64a8df8b95fe147
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
vagrant_abiquo
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.3.3
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
|
5
|
+
gem 'abiquo-api', '~> 0.1.1'
|
6
|
+
gem 'rake'
|
7
|
+
gem 'pry'
|
8
|
+
gem 'pry-byebug'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :plugins do
|
12
|
+
gem "vagrant_abiquo", path: "."
|
13
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/mitchellh/vagrant.git
|
3
|
+
revision: 96368d8a1f778761e74433b83502f119610a6647
|
4
|
+
specs:
|
5
|
+
vagrant (1.9.2.dev)
|
6
|
+
childprocess (~> 0.5.0)
|
7
|
+
erubis (~> 2.7.0)
|
8
|
+
hashicorp-checkpoint (~> 0.1.1)
|
9
|
+
i18n (>= 0.6.0, <= 0.8.0)
|
10
|
+
listen (~> 3.1.5)
|
11
|
+
log4r (~> 1.1.9, < 1.1.11)
|
12
|
+
net-scp (~> 1.1.0)
|
13
|
+
net-sftp (~> 2.1)
|
14
|
+
net-ssh (~> 3.0.1)
|
15
|
+
nokogiri (= 1.6.7.1)
|
16
|
+
rb-kqueue (~> 0.2.0)
|
17
|
+
rest-client (>= 1.6.0, < 3.0)
|
18
|
+
ruby_dep (<= 1.3.1)
|
19
|
+
wdm (~> 0.1.0)
|
20
|
+
winrm (~> 2.1)
|
21
|
+
winrm-elevated (~> 1.1)
|
22
|
+
winrm-fs (~> 1.0)
|
23
|
+
|
24
|
+
PATH
|
25
|
+
remote: .
|
26
|
+
specs:
|
27
|
+
vagrant_abiquo (0.0.2)
|
28
|
+
abiquo-api (~> 0.1.1)
|
29
|
+
log4r
|
30
|
+
|
31
|
+
GEM
|
32
|
+
remote: https://rubygems.org/
|
33
|
+
specs:
|
34
|
+
abiquo-api (0.1.1)
|
35
|
+
addressable (~> 2.4.0, >= 2.4.0)
|
36
|
+
excon (~> 0.43, >= 0.43.0)
|
37
|
+
faraday (~> 0.9.2, >= 0.9.2)
|
38
|
+
faraday_middleware (~> 0.10.0, >= 0.10.0)
|
39
|
+
formatador (~> 0.2, >= 0.2.5)
|
40
|
+
json (~> 2.0, >= 2.0.2)
|
41
|
+
simple_oauth (~> 0.3.1, >= 0.3.1)
|
42
|
+
addressable (2.4.0)
|
43
|
+
builder (3.2.3)
|
44
|
+
byebug (9.0.6)
|
45
|
+
childprocess (0.5.9)
|
46
|
+
ffi (~> 1.0, >= 1.0.11)
|
47
|
+
coderay (1.1.1)
|
48
|
+
domain_name (0.5.20161129)
|
49
|
+
unf (>= 0.0.5, < 1.0.0)
|
50
|
+
erubis (2.7.0)
|
51
|
+
excon (0.55.0)
|
52
|
+
faraday (0.9.2)
|
53
|
+
multipart-post (>= 1.2, < 3)
|
54
|
+
faraday_middleware (0.10.1)
|
55
|
+
faraday (>= 0.7.4, < 1.0)
|
56
|
+
ffi (1.9.17)
|
57
|
+
formatador (0.2.5)
|
58
|
+
gssapi (1.2.0)
|
59
|
+
ffi (>= 1.0.1)
|
60
|
+
gyoku (1.3.1)
|
61
|
+
builder (>= 2.1.2)
|
62
|
+
hashicorp-checkpoint (0.1.4)
|
63
|
+
http-cookie (1.0.3)
|
64
|
+
domain_name (~> 0.5)
|
65
|
+
httpclient (2.8.3)
|
66
|
+
i18n (0.8.0)
|
67
|
+
json (2.0.3)
|
68
|
+
listen (3.1.5)
|
69
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
70
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
71
|
+
ruby_dep (~> 1.2)
|
72
|
+
little-plugger (1.1.4)
|
73
|
+
log4r (1.1.10)
|
74
|
+
logging (2.1.0)
|
75
|
+
little-plugger (~> 1.1)
|
76
|
+
multi_json (~> 1.10)
|
77
|
+
method_source (0.8.2)
|
78
|
+
mime-types (3.1)
|
79
|
+
mime-types-data (~> 3.2015)
|
80
|
+
mime-types-data (3.2016.0521)
|
81
|
+
mini_portile2 (2.0.0)
|
82
|
+
multi_json (1.12.1)
|
83
|
+
multipart-post (2.0.0)
|
84
|
+
net-scp (1.1.2)
|
85
|
+
net-ssh (>= 2.6.5)
|
86
|
+
net-sftp (2.1.2)
|
87
|
+
net-ssh (>= 2.6.5)
|
88
|
+
net-ssh (3.0.2)
|
89
|
+
netrc (0.11.0)
|
90
|
+
nokogiri (1.6.7.1)
|
91
|
+
mini_portile2 (~> 2.0.0.rc2)
|
92
|
+
nori (2.6.0)
|
93
|
+
pry (0.10.4)
|
94
|
+
coderay (~> 1.1.0)
|
95
|
+
method_source (~> 0.8.1)
|
96
|
+
slop (~> 3.4)
|
97
|
+
pry-byebug (3.4.2)
|
98
|
+
byebug (~> 9.0)
|
99
|
+
pry (~> 0.10)
|
100
|
+
rake (12.0.0)
|
101
|
+
rb-fsevent (0.9.8)
|
102
|
+
rb-inotify (0.9.8)
|
103
|
+
ffi (>= 0.5.0)
|
104
|
+
rb-kqueue (0.2.4)
|
105
|
+
ffi (>= 0.5.0)
|
106
|
+
rest-client (2.0.0)
|
107
|
+
http-cookie (>= 1.0.2, < 2.0)
|
108
|
+
mime-types (>= 1.16, < 4.0)
|
109
|
+
netrc (~> 0.8)
|
110
|
+
ruby_dep (1.3.1)
|
111
|
+
rubyntlm (0.6.1)
|
112
|
+
rubyzip (1.2.1)
|
113
|
+
simple_oauth (0.3.1)
|
114
|
+
slop (3.6.0)
|
115
|
+
unf (0.1.4)
|
116
|
+
unf_ext
|
117
|
+
unf_ext (0.0.7.2)
|
118
|
+
wdm (0.1.1)
|
119
|
+
winrm (2.1.2)
|
120
|
+
builder (>= 2.1.2)
|
121
|
+
erubis (~> 2.7)
|
122
|
+
gssapi (~> 1.2)
|
123
|
+
gyoku (~> 1.0)
|
124
|
+
httpclient (~> 2.2, >= 2.2.0.2)
|
125
|
+
logging (>= 1.6.1, < 3.0)
|
126
|
+
nori (~> 2.0)
|
127
|
+
rubyntlm (~> 0.6.0, >= 0.6.1)
|
128
|
+
winrm-elevated (1.1.0)
|
129
|
+
winrm (~> 2.0)
|
130
|
+
winrm-fs (~> 1.0)
|
131
|
+
winrm-fs (1.0.1)
|
132
|
+
erubis (~> 2.7)
|
133
|
+
logging (>= 1.6.1, < 3.0)
|
134
|
+
rubyzip (~> 1.1)
|
135
|
+
winrm (~> 2.0)
|
136
|
+
|
137
|
+
PLATFORMS
|
138
|
+
ruby
|
139
|
+
|
140
|
+
DEPENDENCIES
|
141
|
+
abiquo-api (~> 0.1.1)
|
142
|
+
pry
|
143
|
+
pry-byebug
|
144
|
+
rake
|
145
|
+
vagrant!
|
146
|
+
vagrant_abiquo!
|
147
|
+
|
148
|
+
BUNDLED WITH
|
149
|
+
1.14.5
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Daniel Beneyto
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
Abiquo Vagrant Provider
|
2
|
+
==============================
|
3
|
+
`vagrant_abiquo` is a provider plugin for Vagrant that supports the
|
4
|
+
management of [Abiquo](https://www.abiquo.com/) virtual machines
|
5
|
+
|
6
|
+
Current features include:
|
7
|
+
- create and destroy virtualmachines
|
8
|
+
- power on and off virtualmachines
|
9
|
+
- provision
|
10
|
+
- ssh
|
11
|
+
|
12
|
+
Install
|
13
|
+
-------
|
14
|
+
Installation of the provider requires two steps:
|
15
|
+
|
16
|
+
1. Install the provider plugin using the Vagrant command-line interface:
|
17
|
+
|
18
|
+
```
|
19
|
+
$ vagrant plugin install vagrant_abiquo
|
20
|
+
```
|
21
|
+
|
22
|
+
Configure
|
23
|
+
---------
|
24
|
+
Once the provider has been installed, you will need to configure your project
|
25
|
+
to use it. The most basic `Vagrantfile` to create a virtual machine in Abiquo
|
26
|
+
is shown below:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
VAGRANTFILE_API_VERSION = "2"
|
30
|
+
|
31
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
32
|
+
config.vm.define 'abiquovm'
|
33
|
+
|
34
|
+
config.vm.provider :abiquo do |provider, override|
|
35
|
+
override.vm.box = 'abiquo'
|
36
|
+
override.vm.box_url = "https://github.com/abiquo/vagrant_abiquo/raw/master/box/abiquo.box"
|
37
|
+
|
38
|
+
provider.abiquo_connection_data = {
|
39
|
+
abiquo_api_url: 'http://mothership.bcn.abiquo.com/api',
|
40
|
+
abiquo_username: 'mcirauqui',
|
41
|
+
abiquo_password: 'xxxx'
|
42
|
+
}
|
43
|
+
provider.virtualdatacenter = 'Support Lab - Marc'
|
44
|
+
provider.virtualappliance = 'Tests'
|
45
|
+
provider.template = 'centos 7 v2'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
Please note the following:
|
51
|
+
- You *must* specify the `provider.abiquo_connection_data` hash to connect to
|
52
|
+
Abiquo API.
|
53
|
+
|
54
|
+
**Supported Configuration Attributes**
|
55
|
+
|
56
|
+
The following attributes are available to further configure the provider:
|
57
|
+
- `provider.virtualdatacenter` - A string representing the Virtual Data Center
|
58
|
+
where the VM will be deployed to. The available VDC can be check in the
|
59
|
+
`Virtual Datacenter` section.
|
60
|
+
- `provider.virtualappliance` - A string representing the vApp where to deploy
|
61
|
+
the VM into. It will be created if it does not exist already.
|
62
|
+
- `provider.template` - A string representing the name of an availabe virtual
|
63
|
+
machine template in the VDC. The available templates can be check in the
|
64
|
+
`Apps Library` section.
|
65
|
+
- `provider.cpu_cores` - The number of CPU cores to assign to the virtual machine. If
|
66
|
+
missing, the required CPU from the template will be used.
|
67
|
+
- `provider.ram_mb` - The amount of RAM in MB that will be assigned to the VM. If
|
68
|
+
missing, the required RAM from the template will be used.
|
69
|
+
- `provider.network` - A hash of network and IP pairs. Each key will be a network
|
70
|
+
name in Abiquo, and the value can be a specific IP to attach, or `nil` to
|
71
|
+
autoselect an IP from the network.
|
72
|
+
- `user_data` - An optional user data script to be passed on to the VM. If not
|
73
|
+
specified, the plugin adds a simple provision script to ensure SSH keys are
|
74
|
+
injected to the VM.
|
75
|
+
|
76
|
+
Run
|
77
|
+
---
|
78
|
+
After creating your project's `Vagrantfile` with the required configuration
|
79
|
+
attributes described above, you may create a new virtual machine with the
|
80
|
+
following command:
|
81
|
+
|
82
|
+
$ vagrant up --provider=abiquo
|
83
|
+
|
84
|
+
This command will create a new virtual machine in the specified VDC using
|
85
|
+
the specified template.
|
86
|
+
|
87
|
+
**Supported Commands**
|
88
|
+
|
89
|
+
The provider supports the following Vagrant sub-commands:
|
90
|
+
- `vagrant destroy` - Deletes the virtual machine.
|
91
|
+
- `vagrant ssh` - Logs into the virtual machine using SSH[1].
|
92
|
+
- `vagrant halt` - Powers off the virtual machine.
|
93
|
+
- `vagrant provision` - Runs the configured provisioners and rsyncs any
|
94
|
+
specified `config.vm.synced_folder`.
|
95
|
+
- `vagrant reload` - Resets the virtual machine.
|
96
|
+
- `vagrant status` - Outputs the status (as displayed in Abiquo UI) for the
|
97
|
+
virtual machine.
|
98
|
+
|
99
|
+
[1] For SSH to work, you need to either make sure your SSH keys are available
|
100
|
+
in the virtual machine or override SSH username and password.
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'bundler/gem_helper'
|
2
|
+
|
3
|
+
namespace :gem do
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
end
|
6
|
+
|
7
|
+
task :test do
|
8
|
+
result = sh 'bash -ex test/test.sh'
|
9
|
+
|
10
|
+
if result
|
11
|
+
puts 'Success!'
|
12
|
+
else
|
13
|
+
puts 'Failure!'
|
14
|
+
exit 1
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def env
|
19
|
+
['ABIQUO_API_USER', 'ABIQUO_API_PASSWORD', 'VAGRANT_LOG'].inject('') do |acc, key|
|
20
|
+
acc += "#{key}=#{ENV[key] || 'error'} "
|
21
|
+
end
|
22
|
+
end
|
data/Vagrantfile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
VAGRANTFILE_API_VERSION = "2"
|
2
|
+
|
3
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
4
|
+
config.vm.synced_folder ".", "/vagrant", type: "rsync"
|
5
|
+
|
6
|
+
(1..5).each do |index|
|
7
|
+
config.vm.define "abiquotesting#{index}" do |t|
|
8
|
+
t.vm.hostname = "abiquotesting#{index}"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
config.vm.provider :abiquo do |provider, override|
|
13
|
+
override.vm.box = 'abiquo'
|
14
|
+
override.vm.box_url = "https://github.com/abiquo/vagrant_abiquo/raw/master/box/abiquo.box"
|
15
|
+
override.vm.hostname = 'abiquotesting'
|
16
|
+
|
17
|
+
provider.abiquo_connection_data = {
|
18
|
+
abiquo_api_url: 'https://chirauki40.bcn.abiquo.com/api',
|
19
|
+
abiquo_username: 'admin',
|
20
|
+
abiquo_password: 'xabiquo',
|
21
|
+
connection_options: {
|
22
|
+
ssl: {
|
23
|
+
verify: false
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
provider.cpu_cores = 2
|
28
|
+
provider.ram_mb = 2048
|
29
|
+
provider.virtualdatacenter = 'ESX_VDC'
|
30
|
+
provider.virtualappliance = 'Vagrant Tests'
|
31
|
+
provider.template = 'Centos 7 x86_64'
|
32
|
+
|
33
|
+
provider.network = {
|
34
|
+
'private_dnsmasq' => nil
|
35
|
+
}
|
36
|
+
override.ssh.private_key_path = '~/.ssh/id_rsa'
|
37
|
+
override.ssh.username = 'centos'
|
38
|
+
end
|
39
|
+
end
|
data/box/abiquo.box
ADDED
Binary file
|
data/box/metadata.json
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'vagrant_abiquo/plugin'
|
3
|
+
require 'vagrant_abiquo/helpers/client'
|
4
|
+
|
5
|
+
module VagrantPlugins
|
6
|
+
module Abiquo
|
7
|
+
lib_path = Pathname.new(File.expand_path("../vagrant_abiquo", __FILE__))
|
8
|
+
autoload :Actions, lib_path.join("actions")
|
9
|
+
autoload :Errors, lib_path.join("errors")
|
10
|
+
|
11
|
+
def self.source_root
|
12
|
+
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
13
|
+
end
|
14
|
+
|
15
|
+
I18n.load_path << File.expand_path('locales/en.yml', source_root)
|
16
|
+
I18n.reload!
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
require 'vagrant_abiquo/actions/check_state'
|
2
|
+
require 'vagrant_abiquo/actions/create'
|
3
|
+
require 'vagrant_abiquo/actions/destroy'
|
4
|
+
require 'vagrant_abiquo/actions/power_off'
|
5
|
+
require 'vagrant_abiquo/actions/power_on'
|
6
|
+
require 'vagrant_abiquo/actions/reset'
|
7
|
+
|
8
|
+
module VagrantPlugins
|
9
|
+
module Abiquo
|
10
|
+
module Actions
|
11
|
+
include Vagrant::Action::Builtin
|
12
|
+
|
13
|
+
def self.destroy
|
14
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
15
|
+
builder.use ConfigValidate
|
16
|
+
builder.use Call, CheckState do |env, b|
|
17
|
+
case env[:machine_state]
|
18
|
+
when :not_created
|
19
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.not_created')
|
20
|
+
else
|
21
|
+
b.use Call, DestroyConfirm do |env2, b2|
|
22
|
+
if env2[:result]
|
23
|
+
b2.use Destroy
|
24
|
+
b2.use ProvisionerCleanup if defined?(ProvisionerCleanup)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.up
|
33
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
34
|
+
builder.use ConfigValidate
|
35
|
+
builder.use Call, CheckState do |env, b|
|
36
|
+
case env[:machine_state]
|
37
|
+
when :ON
|
38
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.already_active')
|
39
|
+
when :OFF
|
40
|
+
b.use PowerOn
|
41
|
+
b.use Provision
|
42
|
+
b.use SyncedFolders
|
43
|
+
when :not_created
|
44
|
+
b.use Create
|
45
|
+
b.use Provision
|
46
|
+
b.use SyncedFolders
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.reload
|
53
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
54
|
+
builder.use ConfigValidate
|
55
|
+
builder.use Call, CheckState do |env, b|
|
56
|
+
case env[:machine_state]
|
57
|
+
when :not_created
|
58
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.not_created')
|
59
|
+
else
|
60
|
+
b.use Reset
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.halt
|
67
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
68
|
+
builder.use ConfigValidate
|
69
|
+
builder.use Call, CheckState do |env, b|
|
70
|
+
case env[:machine_state]
|
71
|
+
when :ON
|
72
|
+
b.use PowerOff
|
73
|
+
when :OFF
|
74
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.already_off')
|
75
|
+
when :not_created
|
76
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.not_created')
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.ssh
|
83
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
84
|
+
builder.use ConfigValidate
|
85
|
+
builder.use Call, CheckState do |env, b|
|
86
|
+
case env[:machine_state]
|
87
|
+
when :ON
|
88
|
+
b.use SSHExec
|
89
|
+
when :OFF
|
90
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.off')
|
91
|
+
when :not_created
|
92
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.not_created')
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.ssh_run
|
99
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
100
|
+
builder.use ConfigValidate
|
101
|
+
builder.use Call, CheckState do |env, b|
|
102
|
+
case env[:machine_state]
|
103
|
+
when :ON
|
104
|
+
b.use SSHRun
|
105
|
+
when :OFF
|
106
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.off')
|
107
|
+
when :not_created
|
108
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.not_created')
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.provision
|
115
|
+
return Vagrant::Action::Builder.new.tap do |builder|
|
116
|
+
builder.use ConfigValidate
|
117
|
+
builder.use Call, CheckState do |env, b|
|
118
|
+
case env[:machine_state]
|
119
|
+
when :ON
|
120
|
+
b.use Provision
|
121
|
+
b.use SyncedFolders
|
122
|
+
when :OFF
|
123
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.off')
|
124
|
+
when :not_created
|
125
|
+
env[:ui].info I18n.t('vagrant_abiquo.info.not_created')
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|