From 423f6777163b6a4c6891267ca9d460d0f6bf1d91 Mon Sep 17 00:00:00 2001 From: digimer Date: Thu, 25 Jan 2024 14:38:43 -0500 Subject: [PATCH] Updated Storage->manage_lvm_conf() to only run on EL8. Signed-off-by: digimer --- Anvil/Tools/Storage.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Anvil/Tools/Storage.pm b/Anvil/Tools/Storage.pm index 2a158d39..32159eca 100644 --- a/Anvil/Tools/Storage.pm +++ b/Anvil/Tools/Storage.pm @@ -3232,6 +3232,8 @@ fi;"; =head2 manage_lvm_conf +B<< Note >>: This only works on EL8. If used on another distro, this method will return without actually doing anything. + This method configures C<< lvm.conf >> to add the C<< filter = [ ... ] >> to ensure DRBD devices aren't scanned. If there was a problem, C<< 1 >> is returned. Otherwise, C<< 0 >> is returned. @@ -3274,6 +3276,18 @@ sub manage_lvm_conf target => $target, }}); + ### NOTE: Only add the filter on EL8 machines. + my ($os_type, $os_arch) = $anvil->Get->os_type({debug => $debug}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + os_type => $os_type, + os_arch => $os_arch, + }}); + if ($os_type !~ /\D8/) + { + # Not EL8, return + return(0); + } + my $body = $anvil->Storage->read_file({ debug => $debug, file => $anvil->data->{path}{configs}{'lvm.conf'},