-class lvm {
- case $::hostname {
- ubc-bm8,luchesi: {
- $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'
- }
- grnet-node01,grnet-node02: {
- $conffile = 'lvm-grnet-nodeX-ganeti.conf'
- }
- bm-bl1,bm-bl2,bm-bl3,bm-bl4,bm-bl5,bm-bl6,bm-bl7,bm-bl8,bm-bl9,bm-bl10,bm-bl11,bm-bl12: {
- $conffile = 'lvm-bm-blades.conf'
- }
- prokofiev: {
- $conffile = 'lvm-prokofiev.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;
+ }
}