chef-metal 0.9.3 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b5b77eda4e67ca220d4da85c229bf92a631b929
4
- data.tar.gz: abfe51b9c4acb33b1899db61b79ade829d698142
3
+ metadata.gz: 00a282ef18ac2646f17721192ffadb941fdcb633
4
+ data.tar.gz: 5661ed9e46d23ca6d8a58a7b7ea83e2004dea534
5
5
  SHA512:
6
- metadata.gz: 102d45d0a267f8dabad59a74cf7a90d53313c733e4b965b0fabe5ffe64ad37fa8d38f2a77315e4f4d49f4290e66a50bd6740e01ef4b870607527e456267eed1c
7
- data.tar.gz: 4621a363a04b449146fbe2b79e8f23d98f956fbe2222c1b796ff56316db6670710079548feeb2b176652ae44fcc4a94a57484ef449e92bea69e620a48f896c15
6
+ metadata.gz: 14715c670bde674c517bf4239b558e0cd435e0a9b9bcfee580c71653fc10699b792461563c818f004519c089272365fc38bf47c0c818eb094a451177dd68991a
7
+ data.tar.gz: f11ccb2cea40c9afab0ad34eddd177c297a8ba169a9f34f757048866f36af6ceffea92bc9e5852ad27e78928c536218698c9b62e40b2f45dbc27df71b4eba93c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Chef Metal Changelog
2
2
 
3
+ ## 0.9.4 (4/23/2014)
4
+
5
+ - Preserve provisioner_output in machine resource (don't destroy it!!)
6
+
3
7
  ## 0.9.3 (4/13/2014)
4
8
 
5
9
  - SSH: Treat EHOSTUNREACH as "machine not yet available" (helps with AWS)
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- ChefMetal
2
- =========
1
+ Chef Metal
2
+ ==========
3
3
 
4
4
  This library solves the problem of repeatably creating machines and infrastructures in Chef. It has a plugin model that lets you write bootstrappers for your favorite infrastructures, including VirtualBox, EC2, LXC, bare metal, and many more!
5
5
 
@@ -54,6 +54,11 @@ end
54
54
 
55
55
  You will notice the dynamic nature of the number of web servers. It's all code, your imagination is the limit :)
56
56
 
57
+ Kitchen
58
+ -------
59
+
60
+ Chef Metal also works with Test Kitchen, allowing you to test entire clusters, not just machines! The repository for the kitchen-metal gem is https://github.com/doubt72/kitchen-metal.
61
+
57
62
  Provisioners
58
63
  ------------
59
64
 
@@ -67,6 +72,21 @@ The provisioner API is separated out so that new provisioners can be made with m
67
72
 
68
73
  Provisioners save their data in the Chef node itself, so that they will be accessible to everyone who is using the Chef server to manage the nodes.
69
74
 
75
+ Provisioners each have their own repository. Current provisioners:
76
+
77
+ **Cloud:**
78
+ - [FOG: EC2, DigitalOcean, OpenStack, etc.](https://github.com/opscode/chef-metal-fog)
79
+
80
+ **Virtualization:**
81
+ - [Vagrant: VirtualBox, VMWare Fusion, etc.](https://github.com/opscode/chef-metal-vagrant)
82
+
83
+ **Containers:**
84
+ - [LXC](https://github.com/opscode/chef-metal-lxc)
85
+ - [Docker](https://github.com/opscode/chef-metal-docker)
86
+
87
+ **Bare Metal:**
88
+ - [SSH (no PXE)](https://github.com/double-z/chef-metal-ssh)
89
+
70
90
  ### Vagrant
71
91
 
72
92
  chef-zero comes with a provisioner for Vagrant, an abstraction that covers VirtualBox, VMWare and other Virtual Machine providers. To run it, you can check out the sample recipes with:
@@ -16,6 +16,8 @@ class Chef::Provider::Machine < Chef::Provider::LWRPBase
16
16
  action :create do
17
17
  node_json = node_provider.new_json
18
18
  node_json['normal']['provisioner_options'] = new_resource.provisioner_options
19
+ # Preserve provisioner_output, whatever the cost
20
+ node_json['normal']['provisioner_output'] = node_provider.current_json['normal']['provisioner_output']
19
21
  machine = new_resource.provisioner.acquire_machine(self, node_json)
20
22
  begin
21
23
  machine.setup_convergence(self, new_resource)
@@ -33,6 +35,8 @@ class Chef::Provider::Machine < Chef::Provider::LWRPBase
33
35
  action :converge do
34
36
  node_json = node_provider.new_json
35
37
  node_json['normal']['provisioner_options'] = new_resource.provisioner_options
38
+ # Preserve provisioner_output, whatever the cost
39
+ node_json['normal']['provisioner_output'] = node_provider.current_json['normal']['provisioner_output']
36
40
  machine = new_resource.provisioner.connect_to_machine(node_json)
37
41
  begin
38
42
  machine.converge(self, new_resource.chef_server)
@@ -44,6 +48,8 @@ class Chef::Provider::Machine < Chef::Provider::LWRPBase
44
48
  action :stop do
45
49
  node_json = node_provider.new_json
46
50
  node_json['normal']['provisioner_options'] = new_resource.provisioner_options
51
+ # Preserve provisioner_output, whatever the cost
52
+ node_json['normal']['provisioner_output'] = node_provider.current_json['normal']['provisioner_output']
47
53
  new_resource.provisioner.stop_machine(self, node_json)
48
54
  end
49
55
 
@@ -0,0 +1,49 @@
1
+ require 'chef/provider/lwrp_base'
2
+ require 'chef_metal/provider_action_handler'
3
+ require 'chef/chef_fs/parallelizer'
4
+
5
+ class Chef::Provider::MachineBatch < Chef::Provider::LWRPBase
6
+
7
+ include ChefMetal::ProviderActionHandler
8
+
9
+ use_inline_resources
10
+
11
+ def whyrun_supported?
12
+ true
13
+ end
14
+
15
+ action :create do
16
+ # Collect nodes by provisioner
17
+
18
+ by_provisioner = new_resource.machines.group_by { |machine| machine.provisioner }
19
+ # Talk to each provisioner in parallel
20
+ Chef::ChefFS::Parallelizer.parallelize(by_provisioner) do |provisioner, machines|
21
+ nodes_json = machines.map do |machine|
22
+ node_json = node_providers[machine].node_json
23
+ node_json['normal']['provisioner_options'] = machine.provisioner_options
24
+ node_json
25
+ end
26
+ if provisioner.respond_to?(:acquire_machines)
27
+ provisioner.acquire_machines(self, nodes_json)
28
+ else
29
+ Chef::ChefFS::Parallelizer.parallelize(nodes_json) do |node_json|
30
+ provisioner.acquire_machine(self, node_json)
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ attr_reader :node_providers
37
+
38
+ def load_current_resource
39
+ @node_providers = {}
40
+ new_resource.machines.each do |machine|
41
+ @node_providers[machine] = Chef::Provider.ChefNode.new(machine, nil)
42
+ end
43
+ # Load nodes in parallel
44
+ Chef::ChefFS::Parallelizer.parallelize(@node_providers.values) do |node_provider|
45
+ node_provider.load_current_resource
46
+ end
47
+ end
48
+
49
+ end
@@ -0,0 +1,13 @@
1
+ require 'chef/resource/lwrp_base'
2
+
3
+ class Chef::Resource::MachineBatch < Chef::Resource::LWRPBase
4
+ def initialize(*args)
5
+ super
6
+ @machines = []
7
+ end
8
+
9
+ actions :create, :setup, :converge, :stop
10
+ default_action :create
11
+
12
+ attribute :machines, :kind_of => [ Array ]
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ChefMetal
2
- VERSION = '0.9.3'
2
+ VERSION = '0.9.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-metal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
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-04-14 00:00:00.000000000 Z
11
+ date: 2014-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -151,9 +151,11 @@ files:
151
151
  - README.md
152
152
  - CHANGELOG.md
153
153
  - lib/chef/provider/machine.rb
154
+ - lib/chef/provider/machine_batch.rb
154
155
  - lib/chef/provider/machine_execute.rb
155
156
  - lib/chef/provider/machine_file.rb
156
157
  - lib/chef/resource/machine.rb
158
+ - lib/chef/resource/machine_batch.rb
157
159
  - lib/chef/resource/machine_execute.rb
158
160
  - lib/chef/resource/machine_file.rb
159
161
  - lib/chef_metal/action_handler.rb