X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Flvm%2Fmanifests%2Finit.pp;h=782827ffe8a078ee6a91bfd7b66b48947c1fdd26;hb=9e27d3f0aaa21b93d9d256414dcd6335b07c0f53;hp=0f43639536957e52772f92ed0d2a64ecc5bf113b;hpb=8192ab2604dc581ab3a9acd4b92e203c85bf4f1b;p=mirror%2Fdsa-puppet.git diff --git a/modules/lvm/manifests/init.pp b/modules/lvm/manifests/init.pp index 0f4363953..782827ffe 100644 --- a/modules/lvm/manifests/init.pp +++ b/modules/lvm/manifests/init.pp @@ -1,26 +1,24 @@ -class lvm { - case $::hostname { - dijkstra,luchesi,rossini,salieri: { - $conffile = 'lvm-ubc-ganeti.conf' - } - tristano,pasquini,bertali,boito: { - $conffile = 'lvm-ubc-ganeti-p410.conf' - } - csail-node01,csail-node02: { - $conffile = 'lvm-csail-nodeX-ganeti.conf' - } - default: { - $conffile = '' - } - } +# put a lvm.conf file on the host, +# optionally with the global_filter attribute set, +# with issue_discards set as configured. +class lvm( + Optional[String] $global_filter = undef, + Boolean $issue_discards = false, +) { + if (versioncmp($::lsbmajdistrelease, '10') >= 0) { + $template = 'lvm/lvm.conf-buster.erb' + } else { + $template = 'lvm/lvm.conf-stretch.erb' + } - if $conffile != '' { - package { 'lvm2': - ensure => installed, - } + file { '/etc/lvm/lvm.conf': + ensure => file, + content => template($template), + notify => [ Exec['update-initramfs -u'], Exec['vgscan'] ]; + } - file { '/etc/lvm/lvm.conf': - source => "puppet:///modules/lvm/$conffile", - } - } + exec { 'vgscan': + path => '/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin', + refreshonly => true; + } }