vagrant_filoo 0.0.3 → 0.0.4
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/README.md +23 -4
- data/lib/vagrant_filoo/action/create_server.rb +1 -19
- data/lib/vagrant_filoo/cloud_compute.rb +29 -13
- data/lib/vagrant_filoo/version.rb +1 -1
- data/locales/en.yml +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12efe3a3e4db74434ea32a93b0547ffc8bc447e7
|
4
|
+
data.tar.gz: ae55dfdb5c7739676a41ed842910973d0ccf8c1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaf643457f0d59dff07ca31df21eff65479f503cbac7c1ca63d5a3fa8f19a4a99c7c3090049f0445bd2476b2e7385084cd22f11955d5200e3b910f811f599c6a
|
7
|
+
data.tar.gz: 0fe12d2008eee79b91ea7b11686398200d78062b540b82cda806d386a94e808c71d6b85ee34c23a58fb3d9275d1fb603c714833a40ddc7e216e3e5a493e7e47a
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# vagrant_filoo 0.0.
|
1
|
+
# vagrant_filoo 0.0.4
|
2
2
|
Vagrant filoo provisioner
|
3
3
|
|
4
4
|
This is a Vagrant 1.7x plugin that adds an provider for filoo hosting to Vagrant, allowing Vagrant to control and provision machines within the filoo public and private cloud.
|
@@ -55,7 +55,7 @@ Vagrant.configure("2") do |config|
|
|
55
55
|
#filoo.filoo_api_key = ENV['FILOO_API_KEY']
|
56
56
|
|
57
57
|
filoo.filoo_api_entry_point = "https://api.filoo.de/api/v1"
|
58
|
-
filoo.cd_image_name = "Debian
|
58
|
+
filoo.cd_image_name = "Debian 8.0 - 64bit"
|
59
59
|
filoo.type = "dynamic"
|
60
60
|
filoo.cpu = 1
|
61
61
|
filoo.ram = 128
|
@@ -100,9 +100,10 @@ Vagrant.configure("2") do |config|
|
|
100
100
|
# ... other stuff
|
101
101
|
|
102
102
|
config.vm.provider :filoo do |filoo|
|
103
|
+
config.vm.hostname = "your-hostname"
|
103
104
|
filoo.filoo_api_key = "foo"
|
104
105
|
filoo.filoo_api_entry_point = "bar"
|
105
|
-
filoo.cd_image_name = "
|
106
|
+
filoo.cd_image_name = "SELECT FROM LIST BELOW"
|
106
107
|
end
|
107
108
|
end
|
108
109
|
```
|
@@ -126,7 +127,25 @@ Windows build: https://code.google.com/p/win-sshfs/
|
|
126
127
|
See [Vagrant Synced folders: rsync](https://docs.vagrantup.com/v2/synced-folders/rsync.html)
|
127
128
|
|
128
129
|
|
129
|
-
##
|
130
|
+
## filoo Images you can use
|
131
|
+
|
132
|
+
* Debian 6.0 - 64bit
|
133
|
+
* Endian 2.5.1 Firewall
|
134
|
+
* BalanceNG V3.3 Loadbalancer
|
135
|
+
* Ubuntu 12.04.4 LTS Server - 64bit
|
136
|
+
* CentOS 6.3 - 64bit
|
137
|
+
* Fedora 18 - 64bit
|
138
|
+
* OpenSUSE 12.3 - 64bit
|
139
|
+
* OpenSUSE 13.1 - 64bit
|
140
|
+
* Fedora 20 - 64bit
|
141
|
+
* Ubuntu 14.04 LTS Server - 64bit
|
142
|
+
* CentOS 7.0 - 64bit
|
143
|
+
* Debian 7.7 - 64bit
|
144
|
+
* Debian 7.7 - 64bit + Froxlor
|
145
|
+
* Ubuntu 15.04 Server - 64bit
|
146
|
+
* Debian 8.0 - 64bit
|
147
|
+
* OwnCloud 8.1.2 - 64 bit
|
148
|
+
|
130
149
|
|
131
150
|
|
132
151
|
|
@@ -26,33 +26,15 @@ module VagrantPlugins
|
|
26
26
|
|
27
27
|
imageId = "#{env[:images][config.cd_image_name]}".to_i
|
28
28
|
|
29
|
-
params = {
|
30
|
-
:type => config.type,
|
31
|
-
:cpu => config.cpu,
|
32
|
-
:ram => config.ram,
|
33
|
-
:hdd => config.hdd,
|
34
|
-
:cd_imageid => imageId,
|
35
|
-
:additional_nic => config.additional_nic
|
36
|
-
}
|
37
|
-
|
38
29
|
env[:ui].info("vagrant_filoo creating_instance")
|
39
30
|
env[:ui].info(" -- Type: #{config.type}")
|
40
31
|
env[:ui].info(" -- CPUs: #{config.cpu}")
|
41
32
|
env[:ui].info(" -- Ram: #{config.ram}")
|
42
33
|
env[:ui].info(" -- Image Id: #{imageId}")
|
43
34
|
env[:ui].info(" -- Image Name: #{config.cd_image_name}")
|
44
|
-
env[:result] = VagrantPlugins::Filoo::CloudCompute::createServer(
|
35
|
+
env[:result] = VagrantPlugins::Filoo::CloudCompute::createServer(@baseUrl, @apiKey, config, imageId)
|
45
36
|
env[:machine].id = env[:result]["vmid"]
|
46
37
|
env[:ui].info(" -- Server created with config")
|
47
|
-
#env[:machine].name = env[:result]["custom_vmname"]
|
48
|
-
#env[:result].each do |key, |
|
49
|
-
# if value.kind_of?(String)
|
50
|
-
# env[:ui].info(" #{key}: #{value}")
|
51
|
-
# elsif value.kind_of?(Array)
|
52
|
-
# elsif value.kind_of?(Hash)
|
53
|
-
# end
|
54
|
-
#end
|
55
|
-
#env[:ui].info(" -- Server created, server state #{env[:result]}")
|
56
38
|
env[:ui].info(" -- Server created with config")
|
57
39
|
env[:ui].info(
|
58
40
|
"#{JSON.pretty_generate(env[:result]).gsub!('{','').gsub!('}','').gsub!('"','').gsub!(',','').gsub!('[','').gsub!(']','')}")
|
@@ -24,7 +24,7 @@ module VagrantPlugins
|
|
24
24
|
# Virtual Server Creation and checking #
|
25
25
|
########################################
|
26
26
|
|
27
|
-
CREATE_SERVER_TIMEOUT =
|
27
|
+
CREATE_SERVER_TIMEOUT = 300
|
28
28
|
VALID_TYPES = ['dynamic','fixed']
|
29
29
|
VALID_CPU_COUNTS = [1, 2, 3, 4, 5, 6, 7, 8]
|
30
30
|
VALID_RAM = [128, 256, 512, 1024, 2048, 3072, 4096, 5120, 6144, 7186, 8192]
|
@@ -39,7 +39,15 @@ module VagrantPlugins
|
|
39
39
|
# -cd_imageid ID. Only for images with autoinstall=1.
|
40
40
|
####################################################################
|
41
41
|
|
42
|
-
def self.createServer(
|
42
|
+
def self.createServer(baseUrl, apiKey, filooConfig, imageId)
|
43
|
+
params = {
|
44
|
+
:type => filooConfig.type,
|
45
|
+
:cpu => filooConfig.cpu,
|
46
|
+
:ram => filooConfig.ram,
|
47
|
+
:hdd => filooConfig.hdd,
|
48
|
+
:cd_imageid => imageId,
|
49
|
+
:additional_nic => filooConfig.additional_nic
|
50
|
+
}
|
43
51
|
checkServerParams(params)
|
44
52
|
createServerUrl = baseUrl + CREATE_SERVER_RESOURCE
|
45
53
|
jobId = call4JobId createServerUrl, apiKey, params
|
@@ -92,7 +100,9 @@ module VagrantPlugins
|
|
92
100
|
end
|
93
101
|
|
94
102
|
if params[:additional_nic]
|
95
|
-
|
103
|
+
self.addNic(vmid, baseUrl, apiKey)
|
104
|
+
self.stopInstance(vmid, baseUrl, apiKey)
|
105
|
+
self.startInstance(vmid, baseUrl, apiKey, filooConfig)
|
96
106
|
end
|
97
107
|
serverStatus
|
98
108
|
end
|
@@ -128,7 +138,7 @@ module VagrantPlugins
|
|
128
138
|
end
|
129
139
|
|
130
140
|
# Server removal
|
131
|
-
DELETE_SERVER_TIMEOUT =
|
141
|
+
DELETE_SERVER_TIMEOUT = 120
|
132
142
|
|
133
143
|
def self.deleteServer(vmid, baseUrl, apiKey)
|
134
144
|
deleteServereUrl = baseUrl + DELETE_SERVER_RESOURCE
|
@@ -163,7 +173,7 @@ module VagrantPlugins
|
|
163
173
|
|
164
174
|
# start server
|
165
175
|
|
166
|
-
START_INSTANCE_TIMEOUT =
|
176
|
+
START_INSTANCE_TIMEOUT = 120
|
167
177
|
|
168
178
|
def self.startInstance(vmid, baseUrl, apiKey, filooConfig)
|
169
179
|
|
@@ -187,8 +197,14 @@ module VagrantPlugins
|
|
187
197
|
|
188
198
|
if filooConfig.additional_nic && nicList.count < 1
|
189
199
|
self.addNic(vmid, baseUrl, apiKey)
|
200
|
+
self.stopInstance(vmid, baseUrl, apiKey)
|
201
|
+
self.startInstance(vmid, baseUrl, apiKey, filooConfig)
|
190
202
|
elsif !filooConfig.additional_nic && nicList.count > 0
|
191
|
-
|
203
|
+
raise VagrantPlugins::Filoo::Errors::ConfigError,
|
204
|
+
message: "Provider parameter 'additional_nic' can not be reset to false, please set parameter 'additional_nic' back to true in Vagrantfile"
|
205
|
+
#self.deleteNic(vmid, baseUrl, apiKey)
|
206
|
+
#self.stopInstance(vmid, baseUrl, apiKey)
|
207
|
+
#self.startInstance(vmid, baseUrl, apiKey, filooConfig)
|
192
208
|
end
|
193
209
|
|
194
210
|
url = "#{baseUrl}#{START_RESOURCE}"
|
@@ -229,7 +245,7 @@ module VagrantPlugins
|
|
229
245
|
|
230
246
|
# stop instance
|
231
247
|
|
232
|
-
STOP_INSTANCE_TIMEOUT =
|
248
|
+
STOP_INSTANCE_TIMEOUT = 120
|
233
249
|
|
234
250
|
def self.stopInstance(vmid, baseUrl, apiKey)
|
235
251
|
stopInstanceUrl = baseUrl + STOP_RESOURCE
|
@@ -315,10 +331,9 @@ module VagrantPlugins
|
|
315
331
|
rescue ArgumentError => e
|
316
332
|
raise VagrantPlugins::Filoo::Errors::ConfigError, message: e.message
|
317
333
|
end
|
318
|
-
|
319
334
|
end
|
320
335
|
|
321
|
-
#
|
336
|
+
# delete nic
|
322
337
|
|
323
338
|
def self.deleteNic(vmid, baseUrl, apiKey)
|
324
339
|
|
@@ -327,7 +342,6 @@ module VagrantPlugins
|
|
327
342
|
rescue ArgumentError => e
|
328
343
|
raise VagrantPlugins::Filoo::Errors::ConfigError, message: e.message
|
329
344
|
end
|
330
|
-
|
331
345
|
end
|
332
346
|
|
333
347
|
# server status
|
@@ -468,6 +482,7 @@ module VagrantPlugins
|
|
468
482
|
end
|
469
483
|
sleep 3
|
470
484
|
end
|
485
|
+
puts result
|
471
486
|
result
|
472
487
|
end
|
473
488
|
|
@@ -522,10 +537,11 @@ module VagrantPlugins
|
|
522
537
|
end
|
523
538
|
return {:result => jobResult, :status => 'finished', jobid: jobId, job_command: returnVal['job_command'], job_param: returnVal['job_param']}
|
524
539
|
when 'failed', 'aborted'
|
540
|
+
puts returnVal
|
525
541
|
raise VagrantPlugins::Filoo::Errors::FilooJobFailedError,
|
526
|
-
jobid: returnVal['jobid'],
|
527
|
-
job_command: returnVal['job_command'],
|
528
|
-
job_param: returnVal['job_param'],
|
542
|
+
#jobid: returnVal['jobid'],
|
543
|
+
#job_command: returnVal['job_command'],
|
544
|
+
#job_param: returnVal['job_param'],
|
529
545
|
message: "Job Execution Failed for Task #{returnVal['job_command']} with parameters #{returnVal['job_param']} and Job Id #{returnVal['jobid']}:" + resp.to_json
|
530
546
|
when 'new', 'processing'
|
531
547
|
return nil
|
data/locales/en.yml
CHANGED
@@ -29,11 +29,9 @@ en:
|
|
29
29
|
Error Code %{code}
|
30
30
|
Description %{description}
|
31
31
|
filoo_job_failed_error: |-
|
32
|
-
The remote processing of filoo job
|
32
|
+
The remote processing of filoo job ended with status failed or aborded
|
33
33
|
Message %{message}
|
34
|
-
|
35
|
-
Params %{job_param}
|
36
|
-
Job ID {job_id}
|
34
|
+
|
37
35
|
filoo_job_result_timeout_error: "The remote processing of filo job with uuid %{job_id} took more than the specified timeout of %{timeout} seconds. "
|
38
36
|
gen_error: |-
|
39
37
|
Configuration Error detected.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant_filoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huf Secure Mobile GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|