Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed lvm_device_path to use the mapper device by default #199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion manifests/logical_volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/classes/lvm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down