chef-provisioning 1.2.0 → 1.2.1

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: 8779389e38c408619ab78eefda047f78e5c1826a
4
- data.tar.gz: 61a5f41ab6289315509f7151b9d8e52369a23b8c
3
+ metadata.gz: bdf81e38047405e6ffb044e3112628cd6cce7732
4
+ data.tar.gz: 18351e619438b43f8e2ef7f6622de7a416a4ba84
5
5
  SHA512:
6
- metadata.gz: 5ae3ba3ae5ec38f25ee0aa596d886c42be3a9c47c0c09e9790f03156bccf08989132ff91dfac06f75787ee7b655a804701fb79a66d9c709212977c481e8aeb2a
7
- data.tar.gz: 7ba2b3c08365bccce537dc692913e0e753d096b09293b9fd024b6b31fb58bcea891076b819b483ee5d6fd9ad89f547f7d6584eeb5311ae8d79134a42ccf332c2
6
+ metadata.gz: 846ed8458a5d37d3befd1cc983b81ec7efd26a7d4b5ad10bd43f0485b7c78d8f499ea7f89bea6964bee7735e97b41640dcde5312834d6b59a47013efdeecf014
7
+ data.tar.gz: 800540b188262a24c73cce456a5116aed4d707863025cba6dfbdc9c00af9b6c2bb33cee04f2e3a8bd3d2da5be4b3b2d36847c28a670ad45dfa30a384d0eb8653
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Chef Provisioning Changelog
2
2
 
3
+ ## 1.2.1 (7/17/2015)
4
+
5
+ - Added support for `options[:scp_temp_dir]` to permit specifying a directory other than `/tmp` to copy files to via SCP. ([#339][])
6
+ - Removing acceptance tests because they are super stale. ([#363][])
7
+ - Fix arrity mismatch on `Driver#destroy_image` method. ([#364][])
8
+ - Doc updates ([#344][], [#346][], [#352][], [#369][])
9
+
3
10
  ## 1.2.0 (5/27/2015)
4
11
 
5
12
  - Updating for newly introduced Socketless mode. If the local chef-zero url is `chefzero://...` then we replace it with `http://...` on the target VM ([#337][])
@@ -301,6 +308,13 @@
301
308
  [#321]: https://github.com/chef/chef-provisioning/issues/321
302
309
  [#332]: https://github.com/chef/chef-provisioning/issues/332
303
310
  [#337]: https://github.com/chef/chef-provisioning/issues/337
311
+ [#339]: https://github.com/chef/chef-provisioning/issues/339
312
+ [#344]: https://github.com/chef/chef-provisioning/issues/344
313
+ [#346]: https://github.com/chef/chef-provisioning/issues/346
314
+ [#352]: https://github.com/chef/chef-provisioning/issues/352
315
+ [#363]: https://github.com/chef/chef-provisioning/issues/363
316
+ [#364]: https://github.com/chef/chef-provisioning/issues/364
317
+ [#369]: https://github.com/chef/chef-provisioning/issues/369
304
318
  [@MrMMorris]: https://github.com/MrMMorris
305
319
  [@causton1]: https://github.com/causton1
306
320
  [@chef]: https://github.com/chef
@@ -318,4 +332,4 @@
318
332
  [@segv]: https://github.com/segv
319
333
  [@tyler-ball]: https://github.com/tyler-ball
320
334
  [@xeon22]: https://github.com/xeon22
321
- [@xorl]: https://github.com/xorl
335
+ [@xorl]: https://github.com/xorl
data/README.md CHANGED
@@ -38,6 +38,7 @@ To give it a spin, install Vagrant and VirtualBox and try this from the `chef-pr
38
38
  ```
39
39
  gem install chef-provisioning chef-provisioning-vagrant
40
40
  export CHEF_DRIVER=vagrant
41
+ export VAGRANT_DEFAULT_PROVIDER=virtualbox
41
42
  chef-client -z vagrant_linux.rb simple.rb
42
43
  ```
43
44
 
@@ -48,7 +49,7 @@ This will create two vagrant precise64 linux boxes, "mario" and "luigi1", in `~/
48
49
  If you have an AWS account, you can spin up a machine there like this:
49
50
 
50
51
  ```
51
- gem install chef-provisioning chef-provisioning-fog
52
+ gem install chef-provisioning chef-provisioning-aws
52
53
  export CHEF_DRIVER=aws
53
54
  chef-client -z simple.rb
54
55
  ```
@@ -130,7 +131,7 @@ Drivers each have their own repository. Current drivers:
130
131
 
131
132
  **Virtualization:**
132
133
  - [Vagrant: VirtualBox, VMWare Fusion, etc.](https://github.com/chef/chef-provisioning-vagrant)
133
- - [VSphere](https://github.com/RallySoftware-cookbooks/chef-metal-vsphere) (not yet up to date with 0.11)
134
+ - [VSphere](https://github.com/CenturyLinkCloud/chef-provisioning-vsphere)
134
135
 
135
136
  **Containers:**
136
137
  - [Docker](https://github.com/chef/chef-provisioning-docker)
@@ -147,9 +148,12 @@ chef-zero comes with a provisioner for Vagrant, an abstraction that covers Virtu
147
148
 
148
149
  ```ruby
149
150
  export CHEF_DRIVER=vagrant
151
+ export VAGRANT_DEFAULT_PROVIDER=virtualbox
150
152
  chef-client -z vagrant_linux.rb simple.rb
151
153
  ```
152
154
 
155
+ To use with VMWare, simply update the prior example to read ```export VAGRANT_DEFAULT_PROVIDER=vmware_fusion```
156
+
153
157
  This is a chef-client run, which runs multiple **recipes.** Chef Provisioning is nothing but resources you put in recipes.
154
158
 
155
159
  The driver is specified on the command line. Drivers are URLs. You could use `vagrant:~/vms` or `fog:AWS:default:us-east-1' as driver URLs. More information [here.](https://github.com/chef/chef-provisioning/blob/master/docs/configuration.md#setting-the-driver-with-a-driver-url)
@@ -263,10 +267,10 @@ Kitchen
263
267
  Chef Provisioning 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.
264
268
 
265
269
 
266
- Fixing conflict with chef-zero 3.2.1 and ~> 4.0
270
+ Fixing conflict with chef-zero 3.2.1 and ~> 4.0
267
271
  -----------------------------------------------
268
272
 
269
- If you run into the error `Unable to activate cheffish-1.0.0, because chef-zero-3.2.1 conflicts with chef-zero (~> 4.0)` you'll need to update the version of the chef gem included in the ChefDK. Follow the instructions @ [https://github.com/fnichol/chefdk-update-app](https://github.com/fnichol/chefdk-update-app) and update chef to ~>12.2.1
273
+ If you run into the error `Unable to activate cheffish-1.0.0, because chef-zero-3.2.1 conflicts with chef-zero (~> 4.0)` you'll need to update the version of the chef gem included in the ChefDK. Follow the instructions @ [https://github.com/fnichol/chefdk-update-app](https://github.com/fnichol/chefdk-update-app) and update chef to ~>12.2.1
270
274
 
271
275
  Bugs and The Plan
272
276
  -----------------
@@ -189,7 +189,7 @@ module Provisioning
189
189
  # @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image.
190
190
  # @param [Hash] image_options A set of options representing the desired state of the image
191
191
  # @param [Hash] machine_options A set of options representing the desired state of the machine used to create the image
192
- def destroy_image(action_handler, image_spec, image_options, machine_options)
192
+ def destroy_image(action_handler, image_spec, image_options, machine_options={})
193
193
  raise "#{self.class} does not implement destroy_image"
194
194
  end
195
195
 
@@ -27,6 +27,9 @@ module Provisioning
27
27
  # nil (the default) means no gateway. If the username is omitted,
28
28
  # then the default username is used instead (i.e. the user running
29
29
  # chef, or the username configured in .ssh/config).
30
+ # - :scp_temp_dir: a directory to use as the temporary location for
31
+ # files that are copied to the host via SCP.
32
+ # Only used if :prefix is set. Default is '/tmp' if unspecified.
30
33
  # - global_config: an options hash that looks suspiciously similar to
31
34
  # Chef::Config, containing at least the key :log_level.
32
35
  #
@@ -103,14 +106,18 @@ module Provisioning
103
106
  download(path, local_path)
104
107
  end
105
108
 
109
+ def remote_tempfile(path)
110
+ File.join(scp_temp_dir, "#{File.basename(path)}.#{Random.rand(2**32)}")
111
+ end
112
+
106
113
  def write_file(path, content)
107
114
  execute("mkdir -p #{File.dirname(path)}").error!
108
115
  if options[:prefix]
109
116
  # Make a tempfile on the other side, upload to that, and sudo mv / chown / etc.
110
- remote_tempfile = "/tmp/#{File.basename(path)}.#{Random.rand(2**32)}"
111
- Chef::Log.debug("Writing #{content.length} bytes to #{remote_tempfile} on #{username}@#{host}")
112
- Net::SCP.new(session).upload!(StringIO.new(content), remote_tempfile)
113
- execute("mv #{remote_tempfile} #{path}").error!
117
+ tempfile = remote_tempfile(path)
118
+ Chef::Log.debug("Writing #{content.length} bytes to #{tempfile} on #{username}@#{host}")
119
+ Net::SCP.new(session).upload!(StringIO.new(content), tempfile)
120
+ execute("mv #{tempfile} #{path}").error!
114
121
  else
115
122
  Chef::Log.debug("Writing #{content.length} bytes to #{path} on #{username}@#{host}")
116
123
  Net::SCP.new(session).upload!(StringIO.new(content), path)
@@ -121,14 +128,14 @@ module Provisioning
121
128
  execute("mkdir -p #{File.dirname(path)}").error!
122
129
  if options[:prefix]
123
130
  # Make a tempfile on the other side, upload to that, and sudo mv / chown / etc.
124
- remote_tempfile = "/tmp/#{File.basename(path)}.#{Random.rand(2**32)}"
125
- Chef::Log.debug("Uploading #{local_path} to #{remote_tempfile} on #{username}@#{host}")
126
- Net::SCP.new(session).upload!(local_path, remote_tempfile)
131
+ tempfile = remote_tempfile(path)
132
+ Chef::Log.debug("Uploading #{local_path} to #{tempfile} on #{username}@#{host}")
133
+ Net::SCP.new(session).upload!(local_path, tempfile)
127
134
  begin
128
- execute("mv #{remote_tempfile} #{path}").error!
135
+ execute("mv #{tempfile} #{path}").error!
129
136
  rescue
130
137
  # Clean up if we were unable to move
131
- execute("rm #{remote_tempfile}").error!
138
+ execute("rm #{tempfile}").error!
132
139
  end
133
140
  else
134
141
  Chef::Log.debug("Uploading #{local_path} to #{path} on #{username}@#{host}")
@@ -202,21 +209,21 @@ module Provisioning
202
209
  def download(path, local_path)
203
210
  if options[:prefix]
204
211
  # Make a tempfile on the other side, upload to that, and sudo mv / chown / etc.
205
- remote_tempfile = "/tmp/#{File.basename(path)}.#{Random.rand(2**32)}"
206
- Chef::Log.debug("Downloading #{path} from #{remote_tempfile} to #{local_path} on #{username}@#{host}")
212
+ tempfile = remote_tempfile(path)
213
+ Chef::Log.debug("Downloading #{path} from #{tempfile} to #{local_path} on #{username}@#{host}")
207
214
  begin
208
- execute("cp #{path} #{remote_tempfile}").error!
209
- execute("chown #{username} #{remote_tempfile}").error!
210
- do_download remote_tempfile, local_path
215
+ execute("cp #{path} #{tempfile}").error!
216
+ execute("chown #{username} #{tempfile}").error!
217
+ do_download tempfile, local_path
211
218
  rescue => e
212
- Chef::Log.error "Unable to download #{path} to #{remote_tempfile} on #{username}@#{host} -- #{e}"
219
+ Chef::Log.error "Unable to download #{path} to #{tempfile} on #{username}@#{host} -- #{e}"
213
220
  nil
214
221
  ensure
215
222
  # Clean up afterwards
216
223
  begin
217
- execute("rm #{remote_tempfile}").error!
224
+ execute("rm #{tempfile}").error!
218
225
  rescue => e
219
- Chef::Log.warn "Unable to clean up #{remote_tempfile} on #{username}@#{host} -- #{e}"
226
+ Chef::Log.warn "Unable to clean up #{tempfile} on #{username}@#{host} -- #{e}"
220
227
  end
221
228
  end
222
229
  else
@@ -277,6 +284,10 @@ module Provisioning
277
284
 
278
285
  private
279
286
 
287
+ def scp_temp_dir
288
+ @scp_temp_dir ||= options.fetch(:scp_temp_dir, '/tmp')
289
+ end
290
+
280
291
  def gateway?
281
292
  options.key?(:ssh_gateway) and ! options[:ssh_gateway].nil?
282
293
  end
@@ -1,5 +1,5 @@
1
1
  class Chef
2
2
  module Provisioning
3
- VERSION = '1.2.0'
3
+ VERSION = '1.2.1'
4
4
  end
5
5
  end
@@ -26,7 +26,8 @@ class Machine < Chef::Resource::LWRPBase
26
26
  # Machine options
27
27
  attribute :machine_options
28
28
 
29
- # Node attributes
29
+ # This includes attributes from the Cheffish::Node resources - allows us
30
+ # to specify things like `run_list`, `chef_server`, etc.
30
31
  Cheffish.node_attributes(self)
31
32
 
32
33
  # Client keys
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provisioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef