chef-provisioning 0.16 → 0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +11 -6
- data/lib/.DS_Store +0 -0
- data/lib/chef/.DS_Store +0 -0
- data/lib/chef/provider/load_balancer.rb +6 -34
- data/lib/chef/provider/machine.rb +10 -2
- data/lib/chef/provider/machine_batch.rb +40 -23
- data/lib/chef/provisioning/.DS_Store +0 -0
- data/lib/chef/provisioning/add_prefix_action_handler.rb +4 -0
- data/lib/chef/provisioning/chef_image_spec.rb +3 -0
- data/lib/chef/provisioning/chef_load_balancer_spec.rb +1 -1
- data/lib/chef/provisioning/chef_machine_spec.rb +0 -1
- data/lib/chef/provisioning/convergence_strategy/install_cached.rb +1 -1
- data/lib/chef/provisioning/convergence_strategy/precreate_chef_objects.rb +7 -1
- data/lib/chef/provisioning/driver.rb +4 -5
- data/lib/chef/provisioning/load_balancer_spec.rb +0 -8
- data/lib/chef/provisioning/transport/ssh.rb +4 -2
- data/lib/chef/provisioning/version.rb +1 -1
- data/lib/chef/resource/chef_data_bag_resource.rb +2 -3
- metadata +23 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0c37376aede638b149fb1aa359b47260e7dd532
|
4
|
+
data.tar.gz: c75da4c89e3b9cd12a5a97906f1cc708b4f42989
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27e6d46bbeb25ba1185014913f7c20c5a0adeb73ffe9c1bae191ec914fb3ccfc2ca795a657ab52333720643a80231ea2bead2b65bd899654dfcf7a3c08d313e9
|
7
|
+
data.tar.gz: 9a043f593fa6db7f7a8275fa2a21286bad930bb1be47249dfaa1b0331570d6defefcb51c57dc67b3158168d6ec24f454700245c590220c73f14b19b315eb1172
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
# Chef Provisioning Changelog
|
2
|
+
|
3
|
+
## 0.17 (12/17/2014)
|
4
|
+
|
5
|
+
- Make machine batch convergent
|
6
|
+
- Consolidate load balancer create and update
|
7
|
+
- Update some URLs
|
8
|
+
- SSL verification fix
|
9
|
+
- Test suites
|
10
|
+
- Auto-create image data bags
|
11
|
+
- Remove some un-needed dependencies
|
12
|
+
- Wipe out SSH keys in debug messages
|
13
|
+
|
2
14
|
## 0.16 (11/4/2014)
|
3
15
|
|
4
16
|
- Make it work with Chef 12
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ Date | Blog
|
|
16
16
|
|
17
17
|
Documentation
|
18
18
|
-------------
|
19
|
+
* [Chef Docs](https://docs.getchef.com/provisioning.html)
|
19
20
|
* [Frequently Asked Questions](https://github.com/opscode/chef-provisioning/blob/master/docs/faq.md)
|
20
21
|
* [Configuration](https://github.com/opscode/chef-provisioning/blob/master/docs/configuration.md#configuring-and-using-provisioning-drivers)
|
21
22
|
* [Writing Drivers](https://github.com/opscode/chef-provisioning/blob/master/docs/building_drivers.md#writing-drivers)
|
@@ -118,18 +119,22 @@ Drivers save their data in the Chef node itself, so that they will be accessible
|
|
118
119
|
Drivers each have their own repository. Current drivers:
|
119
120
|
|
120
121
|
**Cloud:**
|
122
|
+
- [AWS](https://github.com/opscode/chef-provisioning-aws)
|
123
|
+
- [Azure](https://github.com/opscode/chef-provisioning-azure)
|
121
124
|
- [FOG: EC2, DigitalOcean, OpenStack, etc.](https://github.com/opscode/chef-provisioning-fog)
|
122
125
|
|
123
126
|
**Virtualization:**
|
124
127
|
- [Vagrant: VirtualBox, VMWare Fusion, etc.](https://github.com/opscode/chef-provisioning-vagrant)
|
125
|
-
- [VSphere](https://github.com/RallySoftware-cookbooks/chef-
|
128
|
+
- [VSphere](https://github.com/RallySoftware-cookbooks/chef-metal-vsphere) (not yet up to date with 0.11)
|
126
129
|
|
127
130
|
**Containers:**
|
128
|
-
- [LXC](https://github.com/opscode/chef-provisioning-lxc) (not yet up to date with 0.11)
|
129
131
|
- [Docker](https://github.com/opscode/chef-provisioning-docker)
|
132
|
+
- [LXC](https://github.com/opscode/chef-provisioning-lxc)
|
130
133
|
|
131
134
|
**Bare Metal:**
|
132
|
-
- [
|
135
|
+
- [Hanlon](https://github.com/opscode/chef-provisioning-hanlon)
|
136
|
+
- [OpenCrowbar](https://github.com/newgoliath/chef-provisioning-crowbar) OpenCrowbar controls your real metal. It discovers, inventories, configs RAID & BIOS and networks, and installs your OS. [OpenCrowbar website](http://www.opencrowbar.org) [OpenCrowbar github](https://github.com/opencrowbar/core)
|
137
|
+
- [SSH (no PXE)](https://github.com/double-z/chef-metal-ssh) (not yet up to date with 0.11)
|
133
138
|
|
134
139
|
### Anatomy of a Recipe
|
135
140
|
|
@@ -147,7 +152,7 @@ The driver is specified on the command line. Drivers are URLs. You could use `
|
|
147
152
|
The `vagrant_linux.rb` recipe handles the physical specification of the machines and Vagrant box:
|
148
153
|
|
149
154
|
```ruby
|
150
|
-
require 'chef/
|
155
|
+
require 'chef/provisioning/vagrant_driver'
|
151
156
|
|
152
157
|
vagrant_box 'precise64' do
|
153
158
|
url 'http://files.vagrantup.com/precise64.box'
|
@@ -158,7 +163,7 @@ with_machine_options :vagrant_options => {
|
|
158
163
|
}
|
159
164
|
```
|
160
165
|
|
161
|
-
`require 'chef/
|
166
|
+
`require 'chef/provisioning/vagrant_driver'` is how we bring in the `vagrant_box` resource.
|
162
167
|
|
163
168
|
`vagrant_box` makes sure a particular vagrant box exists, and lets you specify `machine_options` for things like port forwarding, OS definitions, and any other vagrant-isms.
|
164
169
|
|
@@ -190,7 +195,7 @@ Most Chef Provisioning drivers try hard to provide reasonable defaults so you ca
|
|
190
195
|
You will usually want to create or input a custom key pair for bootstrap. To customize, specify keys and AMI and other options, you can make recipes like this:
|
191
196
|
|
192
197
|
```ruby
|
193
|
-
require 'chef/
|
198
|
+
require 'chef/provisioning/fog_driver'
|
194
199
|
|
195
200
|
fog_key_pair 'my_bootstrap_key'
|
196
201
|
|
data/lib/.DS_Store
ADDED
Binary file
|
data/lib/chef/.DS_Store
ADDED
Binary file
|
@@ -25,44 +25,16 @@ class Chef
|
|
25
25
|
Chef::Provisioning::ChefLoadBalancerSpec.empty(new_resource.name)
|
26
26
|
|
27
27
|
Chef::Log.debug "Creating load balancer: #{new_resource.name}; loaded #{lb_spec.inspect}"
|
28
|
-
|
29
|
-
# Updating
|
30
|
-
update_loadbalancer(lb_spec)
|
31
|
-
else
|
32
|
-
lb_spec.load_balancer_options = new_resource.load_balancer_options
|
33
|
-
lb_spec.machines = new_resource.machines
|
34
|
-
create_loadbalancer(lb_spec)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
action :destroy do
|
39
|
-
lb_spec = Chef::Provisioning::ChefLoadBalancerSpec.get(new_resource.name)
|
40
|
-
new_driver.destroy_load_balancer(@action_handler, lb_spec, lb_options)
|
41
|
-
end
|
28
|
+
machine_specs = new_resource.machines ? new_resource.machines.map { |machine| get_machine_spec(machine) } : nil
|
42
29
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
def update_loadbalancer(lb_spec)
|
47
|
-
Chef::Log.debug "Updating load balancer: #{lb_spec.id}"
|
48
|
-
machines = Hash[
|
49
|
-
*(new_resource.machines).collect {
|
50
|
-
|machine_name| [machine_name, get_machine_spec(machine_name)]
|
51
|
-
}.flatten
|
52
|
-
]
|
53
|
-
new_driver.update_load_balancer(action_handler, lb_spec, lb_options, {
|
54
|
-
:machines => machines
|
55
|
-
}
|
56
|
-
)
|
57
|
-
lb_spec.load_balancer_options = new_resource.load_balancer_options
|
58
|
-
lb_spec.machines = new_resource.machines
|
30
|
+
new_driver.allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
59
31
|
lb_spec.save(action_handler)
|
32
|
+
new_driver.ready_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
60
33
|
end
|
61
34
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
new_driver.ready_load_balancer(action_handler, lb_spec, lb_options)
|
35
|
+
action :destroy do
|
36
|
+
lb_spec = Chef::Provisioning::ChefLoadBalancerSpec.get(new_resource.name)
|
37
|
+
new_driver.destroy_load_balancer(action_handler, lb_spec, lb_options)
|
66
38
|
end
|
67
39
|
|
68
40
|
private
|
@@ -54,9 +54,17 @@ class Machine < Chef::Provider::LWRPBase
|
|
54
54
|
machine_spec.save(action_handler)
|
55
55
|
upload_files(machine)
|
56
56
|
# If we were asked to converge, or anything changed, or if a converge has never succeeded, converge.
|
57
|
-
if new_resource.converge
|
58
|
-
|
57
|
+
if new_resource.converge
|
58
|
+
Chef::Log.info("Converging #{machine_spec.name} because 'converge true' is set ...")
|
59
59
|
machine.converge(action_handler)
|
60
|
+
elsif new_resource.converge.nil? && resource_updated?
|
61
|
+
Chef::Log.info("Converging #{machine_spec.name} because the resource was updated ...")
|
62
|
+
machine.converge(action_handler)
|
63
|
+
elsif !machine_spec.node['automatic'] || machine_spec.node['automatic'].size == 0
|
64
|
+
Chef::Log.info("Converging #{machine_spec.name} because it has never been converged (automatic attributes are empty) ...")
|
65
|
+
machine.converge(action_handler)
|
66
|
+
elsif new_resource.converge == false
|
67
|
+
Chef::Log.debug("Not converging #{machine_spec.name} because 'converge false' is set.")
|
60
68
|
end
|
61
69
|
ensure
|
62
70
|
machine.disconnect
|
@@ -11,7 +11,7 @@ class Provider
|
|
11
11
|
class MachineBatch < Chef::Provider::LWRPBase
|
12
12
|
|
13
13
|
def action_handler
|
14
|
-
@action_handler ||=
|
14
|
+
@action_handler ||= Provisioning::ChefProviderActionHandler.new(self)
|
15
15
|
end
|
16
16
|
|
17
17
|
use_inline_resources
|
@@ -27,8 +27,8 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
27
27
|
action :allocate do
|
28
28
|
by_new_driver.each do |driver, specs_and_options|
|
29
29
|
driver.allocate_machines(action_handler, specs_and_options, parallelizer) do |machine_spec|
|
30
|
-
|
31
|
-
machine_spec.save(
|
30
|
+
m = by_id[machine_spec.id]
|
31
|
+
machine_spec.save(m[:action_handler])
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -39,30 +39,40 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
39
39
|
|
40
40
|
action :setup do
|
41
41
|
with_ready_machines do |m|
|
42
|
-
|
43
|
-
m[:
|
44
|
-
m[:
|
45
|
-
Chef::Provider::Machine.upload_files(prefixed_handler, m[:machine], m[:files])
|
42
|
+
m[:machine].setup_convergence(m[:action_handler])
|
43
|
+
m[:spec].save(m[:action_handler])
|
44
|
+
Chef::Provider::Machine.upload_files(m[:action_handler], m[:machine], m[:files])
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
49
48
|
action :converge do
|
50
49
|
with_ready_machines do |m|
|
51
|
-
|
52
|
-
m[:
|
53
|
-
m[:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
m[:machine].setup_convergence(m[:action_handler])
|
51
|
+
m[:spec].save(m[:action_handler])
|
52
|
+
Chef::Provider::Machine.upload_files(m[:action_handler], m[:machine], m[:files])
|
53
|
+
|
54
|
+
if m[:resource] && m[:resource].converge
|
55
|
+
Chef::Log.info("Converging #{m[:spec].name} because 'converge true' is set ...")
|
56
|
+
m[:machine].converge(m[:action_handler])
|
57
|
+
m[:spec].save(m[:action_handler])
|
58
|
+
elsif (!m[:resource] || m[:resource].converge.nil?) && m[:action_handler].locally_updated
|
59
|
+
Chef::Log.info("Converging #{m[:spec].name} because the resource was updated ...")
|
60
|
+
m[:machine].converge(m[:action_handler])
|
61
|
+
m[:spec].save(m[:action_handler])
|
62
|
+
elsif !m[:spec].node['automatic'] || m[:spec].node['automatic'].size == 0
|
63
|
+
Chef::Log.info("Converging #{m[:spec].name} because it has never been converged (automatic attributes are empty) ...")
|
64
|
+
m[:machine].converge(m[:action_handler])
|
65
|
+
m[:spec].save(m[:action_handler])
|
66
|
+
elsif m[:resource] && m[:resource].converge == false
|
67
|
+
Chef::Log.debug("Not converging #{m[:spec].name} because 'converge false' is set.")
|
68
|
+
end
|
58
69
|
end
|
59
70
|
end
|
60
71
|
|
61
72
|
action :converge_only do
|
62
73
|
parallel_do(@machines) do |m|
|
63
|
-
prefixed_handler = Chef::Provisioning::AddPrefixActionHandler.new(action_handler, "[#{m[:spec].name}] ")
|
64
74
|
machine = run_context.chef_provisioning.connect_to_machine(m[:spec])
|
65
|
-
machine.converge(
|
75
|
+
machine.converge(m[:action_handler])
|
66
76
|
end
|
67
77
|
end
|
68
78
|
|
@@ -80,7 +90,6 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
80
90
|
|
81
91
|
def with_ready_machines
|
82
92
|
action_allocate
|
83
|
-
by_id = @machines.inject({}) { |hash,m| hash[m[:spec].id] = m; hash }
|
84
93
|
parallel_do(by_new_driver) do |driver, specs_and_options|
|
85
94
|
driver.ready_machines(action_handler, specs_and_options, parallelizer) do |machine|
|
86
95
|
machine.machine_spec.save(action_handler)
|
@@ -97,6 +106,10 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
97
106
|
end
|
98
107
|
end
|
99
108
|
|
109
|
+
def by_id
|
110
|
+
@by_id ||= @machines.inject({}) { |hash,m| hash[m[:spec].id] = m; hash }
|
111
|
+
end
|
112
|
+
|
100
113
|
# TODO in many of these cases, the order of the results only matters because you
|
101
114
|
# want to match it up with the input. Make a parallelize method that doesn't
|
102
115
|
# care about order and spits back results as quickly as possible.
|
@@ -151,28 +164,32 @@ class MachineBatch < Chef::Provider::LWRPBase
|
|
151
164
|
provider = Chef::Provider::Machine.new(machine_resource, machine_resource.run_context)
|
152
165
|
provider.load_current_resource
|
153
166
|
{
|
167
|
+
:resource => machine_resource,
|
154
168
|
:spec => provider.machine_spec,
|
155
169
|
:desired_driver => machine_resource.driver,
|
156
170
|
:files => machine_resource.files,
|
157
|
-
:machine_options => proc { |driver| provider.machine_options(driver) }
|
171
|
+
:machine_options => proc { |driver| provider.machine_options(driver) },
|
172
|
+
:action_handler => Provisioning::AddPrefixActionHandler.new(action_handler, "[#{machine_resource.name}] ")
|
158
173
|
}
|
159
|
-
elsif machine.is_a?(
|
174
|
+
elsif machine.is_a?(Provisioning::MachineSpec)
|
160
175
|
machine_spec = machine
|
161
176
|
{
|
162
177
|
:spec => machine_spec,
|
163
178
|
:desired_driver => new_resource.driver,
|
164
179
|
:files => new_resource.files,
|
165
|
-
:machine_options => proc { |driver| machine_options(driver) }
|
180
|
+
:machine_options => proc { |driver| machine_options(driver) },
|
181
|
+
:action_handler => Provisioning::AddPrefixActionHandler.new(action_handler, "[#{machine_spec.name}] ")
|
166
182
|
}
|
167
183
|
else
|
168
184
|
name = machine
|
169
|
-
machine_spec =
|
170
|
-
|
185
|
+
machine_spec = Provisioning::ChefMachineSpec.get(name, new_resource.chef_server) ||
|
186
|
+
Provisioning::ChefMachineSpec.empty(name, new_resource.chef_server)
|
171
187
|
{
|
172
188
|
:spec => machine_spec,
|
173
189
|
:desired_driver => new_resource.driver,
|
174
190
|
:files => new_resource.files,
|
175
|
-
:machine_options => proc { |driver| machine_options(driver) }
|
191
|
+
:machine_options => proc { |driver| machine_options(driver) },
|
192
|
+
:action_handler => Provisioning::AddPrefixActionHandler.new(action_handler, "[#{name}] ")
|
176
193
|
}
|
177
194
|
end
|
178
195
|
end.to_a
|
Binary file
|
@@ -12,18 +12,22 @@ module Provisioning
|
|
12
12
|
|
13
13
|
attr_reader :action_handler
|
14
14
|
attr_reader :prefix
|
15
|
+
attr_reader :locally_updated
|
15
16
|
|
16
17
|
def_delegators :@action_handler, :should_perform_actions, :updated!, :open_stream, :host_node
|
17
18
|
|
18
19
|
def report_progress(description)
|
20
|
+
@locally_updated = true
|
19
21
|
action_handler.report_progress(Array(description).flatten.map { |d| "#{prefix}#{d}" })
|
20
22
|
end
|
21
23
|
|
22
24
|
def performed_action(description)
|
25
|
+
@locally_updated = true
|
23
26
|
action_handler.performed_action(Array(description).flatten.map { |d| "#{prefix}#{d}" })
|
24
27
|
end
|
25
28
|
|
26
29
|
def perform_action(description, &block)
|
30
|
+
@locally_updated = true
|
27
31
|
action_handler.perform_action(Array(description).flatten.map { |d| "#{prefix}#{d}" }, &block)
|
28
32
|
end
|
29
33
|
end
|
@@ -60,6 +60,9 @@ module Provisioning
|
|
60
60
|
_self = self
|
61
61
|
_chef_server = _self.chef_server
|
62
62
|
Chef::Provisioning.inline_resource(action_handler) do
|
63
|
+
# Create the data bag if needed
|
64
|
+
chef_data_bag 'images'
|
65
|
+
# Save the image
|
63
66
|
chef_data_bag_item _self.name do
|
64
67
|
data_bag 'images'
|
65
68
|
chef_server _chef_server
|
@@ -22,7 +22,6 @@ module Provisioning
|
|
22
22
|
chef_api = Cheffish.chef_server_api(chef_server)
|
23
23
|
begin
|
24
24
|
data = chef_api.get("/data/loadbalancers/#{name}")
|
25
|
-
data['load_balancer_options'] = strings_to_symbols(data['load_balancer_options'])
|
26
25
|
ChefLoadBalancerSpec.new(data, chef_server)
|
27
26
|
rescue Net::HTTPServerException => e
|
28
27
|
if e.response.code == '404'
|
@@ -60,6 +59,7 @@ module Provisioning
|
|
60
59
|
_self = self
|
61
60
|
_chef_server = _self.chef_server
|
62
61
|
Chef::Provisioning.inline_resource(action_handler) do
|
62
|
+
chef_data_bag 'loadbalancers'
|
63
63
|
chef_data_bag_item _self.name do
|
64
64
|
data_bag 'loadbalancers'
|
65
65
|
chef_server _chef_server
|
@@ -170,11 +170,17 @@ module Provisioning
|
|
170
170
|
end
|
171
171
|
|
172
172
|
def client_rb_content(chef_server_url, node_name)
|
173
|
+
if chef_server_url.downcase.start_with?("https")
|
174
|
+
ssl_verify_mode = ':verify_peer'
|
175
|
+
else
|
176
|
+
ssl_verify_mode = ':verify_none'
|
177
|
+
end
|
178
|
+
|
173
179
|
<<EOM
|
174
180
|
chef_server_url #{chef_server_url.inspect}
|
175
181
|
node_name #{node_name.inspect}
|
176
182
|
client_key #{convergence_options[:client_pem_path].inspect}
|
177
|
-
ssl_verify_mode
|
183
|
+
ssl_verify_mode #{ssl_verify_mode}
|
178
184
|
EOM
|
179
185
|
end
|
180
186
|
end
|
@@ -270,14 +270,16 @@ module Provisioning
|
|
270
270
|
# @param [ChefMetal::ActionHandler] action_handler The action handler
|
271
271
|
# @param [ChefMetal::LoadBalancerSpec] lb_spec Frozen LB specification
|
272
272
|
# @param [Hash] lb_options A hash of options to pass the LB
|
273
|
-
|
273
|
+
# @param [Array[ChefMetal::MachineSpec]] machine_specs An array of machine specs
|
274
|
+
# the load balancer should have
|
275
|
+
def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
274
276
|
end
|
275
277
|
|
276
278
|
# Make the load balancer ready
|
277
279
|
# @param [ChefMetal::ActionHandler] action_handler The action handler
|
278
280
|
# @param [ChefMetal::LoadBalancerSpec] lb_spec Frozen LB specification
|
279
281
|
# @param [Hash] lb_options A hash of options to pass the LB
|
280
|
-
def ready_load_balancer(action_handler, lb_spec, lb_options)
|
282
|
+
def ready_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
281
283
|
end
|
282
284
|
|
283
285
|
# Destroy the load balancer
|
@@ -287,9 +289,6 @@ module Provisioning
|
|
287
289
|
def destroy_load_balancer(action_handler, lb_spec, lb_options)
|
288
290
|
end
|
289
291
|
|
290
|
-
def update_load_balancer(action_handler, lb_spec, lb_options, opts = {})
|
291
|
-
end
|
292
|
-
|
293
292
|
protected
|
294
293
|
|
295
294
|
def add_prefix(machine_spec, action_handler)
|
@@ -52,14 +52,6 @@ module Provisioning
|
|
52
52
|
load_balancer_data['location'] = value
|
53
53
|
end
|
54
54
|
|
55
|
-
def load_balancer_options
|
56
|
-
load_balancer_data['load_balancer_options']
|
57
|
-
end
|
58
|
-
|
59
|
-
def load_balancer_options=(value)
|
60
|
-
load_balancer_data['load_balancer_options'] = value
|
61
|
-
end
|
62
|
-
|
63
55
|
# URL to the driver. Convenience for location['driver_url']
|
64
56
|
def driver_url
|
65
57
|
location ? location['driver_url'] : nil
|
@@ -182,7 +182,8 @@ module Provisioning
|
|
182
182
|
def session
|
183
183
|
@session ||= begin
|
184
184
|
ssh_start_opts = { timeout:10 }.merge(ssh_options)
|
185
|
-
Chef::Log.debug("Opening SSH connection to #{username}@#{host} with options #{ssh_start_opts.
|
185
|
+
Chef::Log.debug("Opening SSH connection to #{username}@#{host} with options #{ssh_start_opts.dup.tap {
|
186
|
+
|ssh| ssh.delete(:key_data) }.inspect}")
|
186
187
|
# Small initial connection timeout (10s) to help us fail faster when server is just dead
|
187
188
|
begin
|
188
189
|
if gateway? then gateway.ssh(host, username, ssh_start_opts)
|
@@ -285,7 +286,8 @@ module Provisioning
|
|
285
286
|
ssh_start_opts = { timeout:10 }.merge(ssh_options)
|
286
287
|
ssh_start_opts[:port] = gw_port || 22
|
287
288
|
|
288
|
-
Chef::Log.debug("Opening SSH gateway to #{gw_user}@#{gw_host} with options #{ssh_start_opts.
|
289
|
+
Chef::Log.debug("Opening SSH gateway to #{gw_user}@#{gw_host} with options #{ssh_start_opts.dup.tap {
|
290
|
+
|ssh| ssh.delete(:key_data) }.inspect}")
|
289
291
|
begin
|
290
292
|
Net::SSH::Gateway.new(gw_host, gw_user, ssh_start_opts)
|
291
293
|
rescue Errno::ETIMEDOUT
|
@@ -36,10 +36,10 @@ class Chef::Resource::ChefDataBagResource < Chef::Resource::LWRPBase
|
|
36
36
|
# and then delegating to {Chef::Resource::LWRPBase#attribute}
|
37
37
|
# @param attr_name [Symbol] Name of the attribute as a symbol
|
38
38
|
# @return [Void]
|
39
|
-
def self.stored_attribute(attr_name)
|
39
|
+
def self.stored_attribute(attr_name, *args)
|
40
40
|
@stored_attributes ||= []
|
41
41
|
@stored_attributes << attr_name
|
42
|
-
self.attribute attr_name
|
42
|
+
self.attribute attr_name, *args
|
43
43
|
end
|
44
44
|
|
45
45
|
# Load persisted data from the server's databag. If the databag does not exist on the
|
@@ -145,4 +145,3 @@ class Chef::Resource::ChefDataBagResource < Chef::Resource::LWRPBase
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
148
|
-
|
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-provisioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.17'
|
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-
|
11
|
+
date: 2014-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: net-scp
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: net-ssh-gateway
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.2.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: inifile
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '2.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: cheffish
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.8'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.8'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: winrm
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.2.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.2.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description: A library for creating machines and infrastructures idempotently in Chef.
|
@@ -135,6 +135,8 @@ files:
|
|
135
135
|
- LICENSE
|
136
136
|
- README.md
|
137
137
|
- Rakefile
|
138
|
+
- lib/.DS_Store
|
139
|
+
- lib/chef/.DS_Store
|
138
140
|
- lib/chef/provider/load_balancer.rb
|
139
141
|
- lib/chef/provider/machine.rb
|
140
142
|
- lib/chef/provider/machine_batch.rb
|
@@ -142,6 +144,7 @@ files:
|
|
142
144
|
- lib/chef/provider/machine_file.rb
|
143
145
|
- lib/chef/provider/machine_image.rb
|
144
146
|
- lib/chef/provisioning.rb
|
147
|
+
- lib/chef/provisioning/.DS_Store
|
145
148
|
- lib/chef/provisioning/action_handler.rb
|
146
149
|
- lib/chef/provisioning/add_prefix_action_handler.rb
|
147
150
|
- lib/chef/provisioning/chef_image_spec.rb
|
@@ -185,12 +188,12 @@ require_paths:
|
|
185
188
|
- lib
|
186
189
|
required_ruby_version: !ruby/object:Gem::Requirement
|
187
190
|
requirements:
|
188
|
-
- -
|
191
|
+
- - '>='
|
189
192
|
- !ruby/object:Gem::Version
|
190
193
|
version: '0'
|
191
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
195
|
requirements:
|
193
|
-
- -
|
196
|
+
- - '>='
|
194
197
|
- !ruby/object:Gem::Version
|
195
198
|
version: '0'
|
196
199
|
requirements: []
|