chef-metal-vagrant 0.6 → 0.7

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: 42ba70f08cd9d773f590362eb5834a4661733b7d
4
- data.tar.gz: 0d503d578e1b39a64e8153fa922a0fd5a41768bf
3
+ metadata.gz: 9a8d69c824684a912af6c8f37ab60465dffe4fee
4
+ data.tar.gz: ab15a76ad01d484b0503f8920a4d788682d8676d
5
5
  SHA512:
6
- metadata.gz: a39044b884a5133eaae765dd1c15203395f39fbaffadeb99a19bb46a704b68cd109d44a4e203def878ff8cea60b115049b48e745bd51ba52487b78078d3922a3
7
- data.tar.gz: e4803282d13b3e6119a825e2ed3d6483e023b269365464eeb03e1b46748a447a25a9e83af5be1afd9c56f0c2dc9ca06292fac497f606c499919bfec7b212fa35
6
+ metadata.gz: 810fa6b256bc05420dc7d409f1b582e5d433914bc519cbec3b64d2e95d5ed1c2742d0d46ba89d1dc38cc0e7c87f4d4d1cd86643569316ec47712c2f634df98df
7
+ data.tar.gz: 507562488443ae27ca942210faba3383eb40c2dce8e8617c8ce8d1b82f70672184dc8d3531df7449417601dc61e49d8e668370a39597d400af9297a56652deec
@@ -0,0 +1,3 @@
1
+ require 'chef/provisioning/vagrant_driver/driver'
2
+
3
+ ChefMetal.register_driver_class("vagrant", Chef::Provisioning::VagrantDriver::Driver)
@@ -0,0 +1,35 @@
1
+ require 'chef_metal'
2
+ require 'chef/resource/vagrant_cluster'
3
+ require 'chef/provider/vagrant_cluster'
4
+ require 'chef/resource/vagrant_box'
5
+ require 'chef/provider/vagrant_box'
6
+ require 'chef/provisioning/vagrant_driver/driver'
7
+
8
+ class Chef
9
+ module Provisioning
10
+ module VagrantDriver
11
+ def self.with_vagrant_box(run_context, box_name, vagrant_options = {}, &block)
12
+ if box_name.is_a?(Chef::Resource::VagrantBox)
13
+ new_options = { :vagrant_options => { 'vm.box' => box_name.name } }
14
+ new_options[:vagrant_options]['vm.box_url'] = box_name.url if box_name.url
15
+ else
16
+ new_options = { :vagrant_options => { 'vm.box' => box_name } }
17
+ end
18
+
19
+ run_context.chef_metal.add_machine_options(new_options, &block)
20
+ end
21
+ end
22
+ end
23
+
24
+ module DSL
25
+ module Recipe
26
+ def with_vagrant_cluster(cluster_path, &block)
27
+ with_driver("vagrant:#{cluster_path}", &block)
28
+ end
29
+
30
+ def with_vagrant_box(box_name, vagrant_options = {}, &block)
31
+ Chef::Provisioning::VagrantDriver.with_vagrant_box(run_context, box_name, vagrant_options, &block)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -6,13 +6,15 @@ require 'chef_metal/convergence_strategy/install_msi'
6
6
  require 'chef_metal/convergence_strategy/install_cached'
7
7
  require 'chef_metal/transport/winrm'
8
8
  require 'chef_metal/transport/ssh'
9
- require 'chef_metal_vagrant/version'
9
+ require 'chef/provisioning/vagrant_driver/version'
10
10
  require 'chef/resource/vagrant_cluster'
11
11
  require 'chef/provider/vagrant_cluster'
12
12
 
13
- module ChefMetalVagrant
13
+ class Chef
14
+ module Provisioning
15
+ module VagrantDriver
14
16
  # Provisions machines in vagrant.
15
- class VagrantDriver < ChefMetal::Driver
17
+ class Driver < ChefMetal::Driver
16
18
 
17
19
  include Chef::Mixin::ShellOut
18
20
 
@@ -30,7 +32,7 @@ module ChefMetalVagrant
30
32
  attr_reader :cluster_path
31
33
 
32
34
  def self.from_url(driver_url, config)
33
- VagrantDriver.new(driver_url, config)
35
+ Driver.new(driver_url, config)
34
36
  end
35
37
 
36
38
  def self.canonicalize_url(driver_url, config)
@@ -51,7 +53,7 @@ module ChefMetalVagrant
51
53
  old_location = machine_spec.location
52
54
  machine_spec.location = {
53
55
  'driver_url' => driver_url,
54
- 'driver_version' => ChefMetalVagrant::VERSION,
56
+ 'driver_version' => Chef::Provisioning::VagrantDriver::VERSION,
55
57
  'vm_name' => vm_name,
56
58
  'vm_file_path' => vm_file_path,
57
59
  'allocated_at' => Time.now.utc.to_s,
@@ -465,3 +467,5 @@ module ChefMetalVagrant
465
467
  end
466
468
  end
467
469
  end
470
+ end
471
+ end
@@ -0,0 +1,7 @@
1
+ class Chef
2
+ module Provisioning
3
+ module VagrantDriver
4
+ VERSION = '0.7'
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  require 'chef/resource/lwrp_base'
2
- require 'chef_metal_vagrant'
2
+ require 'chef/provisioning/vagrant_driver'
3
3
 
4
4
  class Chef::Resource::VagrantBox < Chef::Resource::LWRPBase
5
5
  self.resource_name = 'vagrant_box'
@@ -13,6 +13,11 @@ class Chef::Resource::VagrantBox < Chef::Resource::LWRPBase
13
13
 
14
14
  def after_created
15
15
  super
16
- ChefMetalVagrant.with_vagrant_box run_context, self
16
+ Chef::Provisioning::VagrantDriver.with_vagrant_box run_context, self
17
+ end
18
+
19
+ # We are not interested in Chef's cloning behavior here.
20
+ def load_prior_resource
21
+ Chef::Log.debug("Overloading #{resource_name}.load_prior_resource with NOOP")
17
22
  end
18
23
  end
@@ -1,5 +1,5 @@
1
1
  require 'chef/resource/lwrp_base'
2
- require 'chef_metal_vagrant'
2
+ require 'chef/provisioning/vagrant_driver'
3
3
 
4
4
  class Chef::Resource::VagrantCluster < Chef::Resource::LWRPBase
5
5
  self.resource_name = 'vagrant_cluster'
@@ -13,4 +13,9 @@ class Chef::Resource::VagrantCluster < Chef::Resource::LWRPBase
13
13
  super
14
14
  run_context.chef_metal.with_driver "vagrant:#{path}"
15
15
  end
16
+
17
+ # We are not interested in Chef's cloning behavior here.
18
+ def load_prior_resource
19
+ Chef::Log.debug("Overloading #{resource_name}.load_prior_resource with NOOP")
20
+ end
16
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-metal-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -79,12 +79,12 @@ files:
79
79
  - Rakefile
80
80
  - lib/chef/provider/vagrant_box.rb
81
81
  - lib/chef/provider/vagrant_cluster.rb
82
+ - lib/chef/provisioning/driver_init/vagrant.rb
83
+ - lib/chef/provisioning/vagrant_driver.rb
84
+ - lib/chef/provisioning/vagrant_driver/driver.rb
85
+ - lib/chef/provisioning/vagrant_driver/version.rb
82
86
  - lib/chef/resource/vagrant_box.rb
83
87
  - lib/chef/resource/vagrant_cluster.rb
84
- - lib/chef_metal/driver_init/vagrant.rb
85
- - lib/chef_metal_vagrant.rb
86
- - lib/chef_metal_vagrant/vagrant_driver.rb
87
- - lib/chef_metal_vagrant/version.rb
88
88
  homepage: https://github.com/opscode/chef-metal-fog
89
89
  licenses: []
90
90
  metadata: {}
@@ -1,3 +0,0 @@
1
- require 'chef_metal_vagrant/vagrant_driver'
2
-
3
- ChefMetal.register_driver_class("vagrant", ChefMetalVagrant::VagrantDriver)
@@ -1,33 +0,0 @@
1
- require 'chef_metal'
2
- require 'chef/resource/vagrant_cluster'
3
- require 'chef/provider/vagrant_cluster'
4
- require 'chef/resource/vagrant_box'
5
- require 'chef/provider/vagrant_box'
6
- require 'chef_metal_vagrant/vagrant_driver'
7
-
8
- module ChefMetalVagrant
9
- def self.with_vagrant_box(run_context, box_name, vagrant_options = {}, &block)
10
- if box_name.is_a?(Chef::Resource::VagrantBox)
11
- new_options = { :vagrant_options => { 'vm.box' => box_name.name } }
12
- new_options[:vagrant_options]['vm.box_url'] = box_name.url if box_name.url
13
- else
14
- new_options = { :vagrant_options => { 'vm.box' => box_name } }
15
- end
16
-
17
- run_context.chef_metal.add_machine_options(new_options, &block)
18
- end
19
- end
20
-
21
- class Chef
22
- module DSL
23
- module Recipe
24
- def with_vagrant_cluster(cluster_path, &block)
25
- with_driver("vagrant:#{cluster_path}", &block)
26
- end
27
-
28
- def with_vagrant_box(box_name, vagrant_options = {}, &block)
29
- ChefMetalVagrant.with_vagrant_box(run_context, box_name, vagrant_options, &block)
30
- end
31
- end
32
- end
33
- end
@@ -1,3 +0,0 @@
1
- module ChefMetalVagrant
2
- VERSION = '0.6'
3
- end