diff --git a/lib/puppet/provider/volume_group/lvm.rb b/lib/puppet/provider/volume_group/lvm.rb index 46fcef32..23f0720a 100644 --- a/lib/puppet/provider/volume_group/lvm.rb +++ b/lib/puppet/provider/volume_group/lvm.rb @@ -58,6 +58,21 @@ def exists? end def physical_volumes=(new_volumes = []) + # Need to replace device path with real names, instead of symlink + if @resource.parameter(:followsymlinks).value == :true then + new_volume_real = [] + new_volumes.each do |s| + if File.symlink?(s) + device = File.expand_path(File.readlink(s), File.dirname(s)) + new_volume_real.push device + else + real_should.push s + end + end + new_volumes = new_volume_real + end + + # Only take action if createonly is false just to be safe # this is really only here to enforce the createonly setting # if something goes wrong in physical_volumes