From f0069451ab84eb7e5e7b6fbe008896c4da51191c Mon Sep 17 00:00:00 2001 From: Curt Wilhelm Date: Fri, 8 Jan 2016 12:16:03 -0700 Subject: [PATCH] run vgs command during converg instead of compile time support for byocm --- metadata.rb | 2 +- recipes/default.rb | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/metadata.rb b/metadata.rb index af69492..cd1fa3e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,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 '1.0.11' +version '1.0.12' supports 'ubuntu' supports 'centos' diff --git a/recipes/default.rb b/recipes/default.rb index 05c942e..448ffae 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -39,17 +39,21 @@ # Ephemeral disks may have been previously formatted, which can hang some lvm calls. # Run 'wipefs' on each ephemeral disk to remove any filesystem signatures. - # - check_volume_group = Mixlib::ShellOut.new("vgs #{node['ephemeral_lvm']['volume_group_name']}").run_command - if check_volume_group.exitstatus != 0 - ephemeral_devices.each do |ephemeral_device| - log "Preparing #{ephemeral_device}" - execute "wipefs --all #{ephemeral_device}" + ruby_block "vgs command" do + block do + check_volume_group = Mixlib::ShellOut.new("vgs #{node['ephemeral_lvm']['volume_group_name']}").run_command + if check_volume_group.exitstatus != 0 + ephemeral_devices.each do |ephemeral_device| + Chef::Log.info "Preparing #{ephemeral_device}" + Mixlib::ShellOut.new( "wipefs --all #{ephemeral_device}").run_command + end + else + Chef::Log.info "No need to remove ephemeral disk filesystem signatures." + end end - else - log "No need to remove ephemeral disk filesystem signatures." end + # Create the volume group and logical volume. If more than one ephemeral disk is found, # they are created with LVM stripes with the stripe size set in the attributes. #