From 27cc02d57949e45de0be30d549bb40869387fd73 Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Thu, 26 Jan 2017 09:11:20 -0600 Subject: [PATCH] Lvm 4 0 (#61) * Added attribute for wipe_attributes to pass along to the lvm_volump_group resource * Allow gem deps to vary within major version This fixes this error, which was solved in newer versions of Ridley: An error occurred while reading the Berksfile: uninitialized constant Ridley::Mixin::ParamsValidate::ValidationFailed https://travis-ci.org/rightscale-cookbooks/ephemeral_lvm/builds/125138768 * according to chai gce changed metadata ephemeral drives have type "LOCAL-SSD" now "gce": { "attached_disks": { "disks": [ { "deviceName": "persistent-disk-0", "index": 0, "mode": "READ_WRITE", "type": "PERSISTENT" }, { "deviceName": "local-ssd-0", "index": 1, "mode": "READ_WRITE", "type": "LOCAL-SSD" } ] }, * updated metadata and changeling * updating to lvm-3.0 * additional try for wipefs as new version supports -f flag * fix deprecation warning, using allow instead of should_receive * chef 12 migration * updating travis * updating net-persistent-http * fixing versions * updating from skeleton for tests * adding gitignore * updating for cookstyle * removing berksfile.lock * adding .travis_install.sh * removing centos7.0 * removing apt * updating ruby-version * updating rakefile and travis * pinning Berksfile.lock * updating readme to chef12 * using pipmychangelog * fixes #57 * updating lvm to 4.0.5 * updating changelog * reverting to 3.1.0, since 4.0.x has breaking changes * updating to lvm 4.0.5, closes #60 Signed-off-by: Richard Shade * updating to >=4.0, closes #62 * updating changelog * fixing gce tests, closes #58 * fixing for cookstyle --- .kitchen.yml | 6 +++--- Berksfile.lock | 8 ++++---- CHANGELOG.md | 9 ++++++++- metadata.rb | 4 ++-- test/cookbooks/fake/metadata.rb | 2 +- test/cookbooks/fake/recipes/gce.rb | 9 ++++++--- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 54885ab..112c469 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -54,7 +54,7 @@ suites: # loopback devices "/dev/loop0" and "/dev/loop1" # - name: gce - run_list: ["recipe[fake::gce]", "recipe[ephemeral_lvm]"] + run_list: ["recipe[fake]","recipe[fake::gce]", "recipe[ephemeral_lvm]"] attributes: cloud: provider: gce @@ -65,11 +65,11 @@ suites: index: 0 mode: READ_WRITE type: EPHEMERAL - - deviceName: ephemeral-disk-0 + - deviceName: local-ssd-0 index: 1 mode: READ_WRITE type: EPHEMERAL - - deviceName: ephemeral-disk-1 + - deviceName: local-ssd-1 index: 2 mode: READ_WRITE type: EPHEMERAL diff --git a/Berksfile.lock b/Berksfile.lock index e8a35b6..6d6d1bf 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -6,9 +6,9 @@ DEPENDENCIES path: test/cookbooks/fake GRAPH - ephemeral_lvm (2.1.0) - lvm (~> 3.1.0) + ephemeral_lvm (3.0.0) + lvm (>= 4.0.0) now (>= 0.0.0) - fake (0.1.0) - lvm (3.1.0) + fake (0.1.1) + lvm (4.0.5) now (1.0.0) diff --git a/CHANGELOG.md b/CHANGELOG.md index b92ca16..5d59bed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ephemeral_lvm Cookbook CHANGELOG This file is used to list changes made in each version of the ephemeral_lvm cookbook. +v3.0.0 +------ +- locks to [lvm](https://github.com/chef-cookbooks/lvm) >= 4.0, Issues: ([#60][], [#62][]), PR: [#61][] + v2.1.0 ------ - [lvm-3.1.0](https://github.com/chef-cookbooks/lvm/releases/tag/v3.1.0) @@ -130,10 +134,13 @@ v1.0.0 [#48]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/48 [#50]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/50 [#54]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/54 +[#60]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/60 +[#61]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/61 +[#62]: https://github.com/rightscale-cookbooks/ephemeral_lvm/issues/62 [@areznikov-kabam]: https://github.com/areznikov-kabam [@autrejacoupa]: https://github.com/autrejacoupa [@drywheat]: https://github.com/drywheat [@felka]: https://github.com/felka [@freimer]: https://github.com/freimer [@juliandunn]: https://github.com/juliandunn -[@kingpong]: https://github.com/kingpong +[@kingpong]: https://github.com/kingpong \ No newline at end of file diff --git a/metadata.rb b/metadata.rb index aef0c43..8a2cc53 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ license 'Apache 2.0' description 'Configures available ephemeral devices on a cloud server' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '2.1.0' +version '3.0.0' issues_url 'https://github.com/rightscale-cookbooks/ephemeral_lvm/issues' if respond_to?(:issues_url) source_url 'https://github.com/rightscale-cookbooks/ephemeral_lvm' if respond_to?(:source_url) chef_version '>= 12.0' if respond_to?(:chef_version) @@ -15,7 +15,7 @@ supports 'debian' depends 'now' -depends 'lvm', '~> 3.1.0' +depends 'lvm', '>= 4.0' recipe 'ephemeral_lvm::default', 'Sets up ephemeral devices on a cloud server' diff --git a/test/cookbooks/fake/metadata.rb b/test/cookbooks/fake/metadata.rb index 4807072..da7e0c4 100644 --- a/test/cookbooks/fake/metadata.rb +++ b/test/cookbooks/fake/metadata.rb @@ -5,4 +5,4 @@ license 'Apache 2.0' description 'A fake cookbook to prepare the test environment for ephemeral_lvm' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.1.0' +version '0.1.1' diff --git a/test/cookbooks/fake/recipes/gce.rb b/test/cookbooks/fake/recipes/gce.rb index cceb92f..fe4d8cc 100644 --- a/test/cookbooks/fake/recipes/gce.rb +++ b/test/cookbooks/fake/recipes/gce.rb @@ -21,15 +21,18 @@ # Include the fake::default recipe which sets up the loopback # devices used in the test. # +Chef::Log.info 'including fake recipe' include_recipe 'fake' # Setup the links for ephemeral devices for google by id # node['fake']['devices'].each do |device| - match = device.match(%{\/dev\/loop(\d+)}) + match = device.match(%r{\/dev\/loop(\d+)}) next if match.nil? device_index = match[1] - link "/dev/disk/by-id/google-ephemeral-disk-#{device_index}" do + Chef::Log.info "adding in device: #{device}" + link "/dev/disk/by-id/google-local-ssd-#{device_index}" do to device - end + action :nothing + end.run_action(:create) end