From eeab883a2c1a3263e625d38230f85f66508d62c0 Mon Sep 17 00:00:00 2001 From: Kevin Van Poppel Date: Fri, 24 Nov 2017 10:38:10 +0100 Subject: [PATCH 1/2] Changed lvm_device_path to use the mapper device by default --- manifests/logical_volume.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/logical_volume.pp b/manifests/logical_volume.pp index 8ece160e..5df17b41 100644 --- a/manifests/logical_volume.pp +++ b/manifests/logical_volume.pp @@ -28,9 +28,14 @@ $no_sync = undef, $region_size = undef, $alloc = undef, + Boolean $use_mapper_device = true, ) { - $lvm_device_path = "/dev/${volume_group}/${name}" + if $use_mapper_device { + $lvm_device_path = "/dev/mapper/${volume_group}-${name}" + } else { + $lvm_device_path = "/dev/${volume_group}/${name}" + } if $mountpath_require and $fs_type != 'swap' { Mount { From 93c9ceb14cb8bf33d424addc263f3dc58e78220b Mon Sep 17 00:00:00 2001 From: Kevin Van Poppel Date: Fri, 24 Nov 2017 10:58:42 +0100 Subject: [PATCH 2/2] Updated spec test to comply with modified filesystem paths --- spec/unit/classes/lvm_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/unit/classes/lvm_spec.rb b/spec/unit/classes/lvm_spec.rb index c091c109..02cbf8e2 100644 --- a/spec/unit/classes/lvm_spec.rb +++ b/spec/unit/classes/lvm_spec.rb @@ -40,14 +40,14 @@ :volume_group => 'myvg', :size => '20G' }) } - it { should contain_filesystem('/dev/myvg/opt') } + it { should contain_filesystem('/dev/mapper/myvg-opt') } it { should contain_mount('/opt') } it { should contain_logical_volume('backup').with({ :volume_group => 'myvg', :size => '5G' }) } - it { should contain_filesystem('/dev/myvg/backup') } + it { should contain_filesystem('/dev/mapper/myvg-backup') } it { should contain_mount('/var/backups') } end @@ -101,11 +101,11 @@ :volume_group => 'myvg', :size => '20G' }) } - it { should contain_filesystem('/dev/myvg/swap').with({ + it { should contain_filesystem('/dev/mapper/myvg-swap').with({ :fs_type => 'swap' }) } - it { should contain_mount('/dev/myvg/swap').with({ - :name => 'swap_/dev/myvg/swap', + it { should contain_mount('/dev/mapper/myvg-swap').with({ + :name => 'swap_/dev/mapper/myvg-swap', :ensure => 'present', :fstype => 'swap', :pass => 0,