vagrant-libcloud-helper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 521337bb97a99df321e636a28da41573a23f233c
4
- data.tar.gz: 83f91feb8cff450f4a06b85d7b6235a3a59c60c5
3
+ metadata.gz: 24649215d1a47c716fd8e368983e0c885a3bdf33
4
+ data.tar.gz: c070a3203a8d8cf41073d08c7473535f87c4399e
5
5
  SHA512:
6
- metadata.gz: 77178efe6e9d3953e111487f02f1daa617f78f44d45b35fcfc02f49e00153f2720b6e49be295f984f0f359b4717660edde4b5a5cbd269f2245044a36ff403c37
7
- data.tar.gz: c4a8778c1cc0e4a44b0e835c649186128f6c5dcb1cb2c78125bdcc705986ebb494114fbb260c0cb2763db0b4189344a197c4f3e7bcd299a2aac669bf8d7a12c5
6
+ metadata.gz: 9d3a340a155b81f1f078c8883b7578b6517640369d3a18d73a57b09d94fe4da6f81ab5fd6a31ce7bd4fadd8e46d2b37bade9001b61d58e8388e8517296115f49
7
+ data.tar.gz: 4a0e8623e3896e1d8032c7f59932d00095a18b64fb9b09318d2a97bc9aca2c210f732fc0a74be3ccbeb8b60e67908ad9b61ad3c11a75ab65229b1889f4d54514
data/README.md CHANGED
@@ -10,7 +10,9 @@ At the moment only VirtualBox instances are supported.
10
10
  boxes:
11
11
 
12
12
  * Allocate all SATA ports of the first SATA interface, so that disks may be
13
- hot-plugged once the machine is up.
13
+ hot-plugged once the machine is up. If no SATA controller is found, one
14
+ will be created.
15
+
14
16
 
15
17
  ## Installation
16
18
 
@@ -26,19 +28,23 @@ If you want to use this plugin outside
26
28
  [libcloud-vagrant](https://github.com/carletes/libcloud-vagrant), you just
27
29
  need to enable the bits you want.
28
30
 
31
+ ### Allocation of SATA ports
32
+
29
33
  The following `Vagrantfile` snippet activates the allocation of all SATA
30
- ports:
34
+ ports (A new SATA controller will be created if none is found):
31
35
 
32
36
  ```ruby
33
37
  Vagrant.configure("2") do |config|
34
38
 
35
39
  if Vagrant.has_plugin?("vagrant-libcloud-helper")
36
- config.libcloud_helper.allocate_sata_ports = true
40
+ config.libcloud_helper.allocate_sata_ports = 30
37
41
  end
38
42
 
39
43
  # [..]
40
44
  end
41
45
  ```
46
+ By default no SATA ports will be allocated.
47
+
42
48
 
43
49
  ## Compatibility
44
50
 
@@ -46,3 +52,22 @@ This plugin has been tested under 64-bit Linux with:
46
52
 
47
53
  * Vagrant 1.6.3
48
54
  * VirtualBox 4.3.14
55
+
56
+
57
+ ## Credits
58
+
59
+ Most of the code here was taken from the
60
+ [vagrant-persistent-storage](https://github.com/kusnier/vagrant-persistent-storage]) plugin.
61
+
62
+
63
+ ## Changes
64
+
65
+ ### Version 0.0.2
66
+
67
+ * The config parameter `config.libcloud_helper.allocate_sata_ports` is now an
68
+ integer, representing the number of SATA ports to allocate.
69
+
70
+
71
+ ### Version 0.0.1
72
+
73
+ * Initial release.
data/Vagrantfile CHANGED
@@ -3,12 +3,17 @@
3
3
 
4
4
  Vagrant.configure("2") do |config|
5
5
 
6
- # This plugin must be explicitly enabled. Do it like this:
7
- config.libcloud_helper.allocate_sata_ports = true
8
-
9
6
  config.vm.define "precise64" do |n|
10
7
  n.vm.hostname = "precise64"
11
8
  n.vm.box = "hashicorp/precise64"
9
+
10
+ # The number of ports must be specified, since the default is 0
11
+ n.libcloud_helper.allocate_sata_ports = 30
12
+ end
13
+
14
+ config.vm.define "precise64-no-allocate" do |n|
15
+ n.vm.hostname = "precise64-no-allocate"
16
+ n.vm.box = "hashicorp/precise64"
12
17
  end
13
18
 
14
19
  # Test on a non-Linux box. This one, for instance, has no SATA adapter.
@@ -16,6 +21,8 @@ Vagrant.configure("2") do |config|
16
21
  n.vm.hostname = "openbsd55"
17
22
  n.vm.box = "tmatilai/openbsd-5.5"
18
23
 
24
+ n.libcloud_helper.allocate_sata_ports = 2
25
+
19
26
  # This Vagrant box does not boot when the host is behind an HTTP/FTPs
20
27
  # proxy, beacuse Vagrant tries to install the OpenBSD package ``rsync``
21
28
  # in order to implement rsync shared folders, which are the default.
@@ -11,9 +11,10 @@ module VagrantPlugins
11
11
  def call(env)
12
12
  return @app.call(env) if @machine.state.id != :poweroff && [:up].include?(env[:machine_action])
13
13
 
14
- if env[:machine].config.libcloud_helper.allocate_sata_ports
14
+ numports = env[:machine].config.libcloud_helper.allocate_sata_ports
15
+ if numports > 0
15
16
  env[:ui].info "Allocating SATA ports"
16
- env[:machine].provider.driver.allocate_sata_ports
17
+ env[:machine].provider.driver.allocate_sata_ports numports
17
18
  end
18
19
 
19
20
  @app.call(env)
@@ -11,7 +11,11 @@ module VagrantPlugins
11
11
  end
12
12
 
13
13
  def finalize!
14
- @allocate_sata_ports = false if @allocate_sata_ports == UNSET_VALUE
14
+ if @allocate_sata_ports == UNSET_VALUE
15
+ @allocate_sata_ports = 0
16
+ else
17
+ @allocate_sata_ports = [@allocate_sata_ports, 30].min
18
+ end
15
19
  end
16
20
 
17
21
  def validate(machine)
@@ -3,9 +3,8 @@ module VagrantPlugins
3
3
  module Driver
4
4
  class Base
5
5
 
6
- def allocate_sata_ports
6
+ def allocate_sata_ports(portcount)
7
7
  controller = get_sata_controller_name
8
- portcount = 30
9
8
  if controller.nil?
10
9
  controller = "SATA Controller"
11
10
  @logger.info("Creating SATA controller '#{controller}' with #{portcount} ports")
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module LibcloudHelper
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-libcloud-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Valiente
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-11 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.0.3
83
+ rubygems_version: 2.0.14
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: This plugins performs low-level changes to the life-cycle of Virtualbox guests