Skip to content

Commit

Permalink
Merge pull request #37 from cdwilhelm/curt-dev
Browse files Browse the repository at this point in the history
run vgs command during converge instead of compile time
  • Loading branch information
cdwilhelm committed Feb 10, 2016
2 parents a28d780 + f006945 commit 8786c8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
20 changes: 12 additions & 8 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down

0 comments on commit 8786c8f

Please sign in to comment.