|
14 | 14 | Boolean $mountpath_require = false, |
15 | 15 | Boolean $mounted = true, |
16 | 16 | Boolean $createfs = true, |
| 17 | + Boolean $use_fs_label = false, |
17 | 18 | $extents = undef, |
18 | 19 | $stripes = undef, |
19 | 20 | $stripesize = undef, |
|
32 | 33 |
|
33 | 34 | $lvm_device_path = "/dev/${volume_group}/${name}" |
34 | 35 |
|
| 36 | + $mount_device = $use_fs_label ? { |
| 37 | + false => $lvm_device_path, |
| 38 | + true => "LABEL=${name}", |
| 39 | + } |
| 40 | + |
| 41 | + $mkfs_label = $use_fs_label ? { |
| 42 | + false => '', |
| 43 | + # the ending whitespace is required |
| 44 | + true => "-L ${name} ", |
| 45 | + } |
| 46 | + |
35 | 47 | if $mountpath_require and $fs_type != 'swap' { |
36 | 48 | Mount { |
37 | 49 | require => File[$mountpath], |
38 | 50 | } |
39 | 51 | } |
40 | 52 |
|
41 | 53 | if $fs_type == 'swap' { |
42 | | - $mount_title = $lvm_device_path |
43 | | - $fixed_mountpath = "swap_${lvm_device_path}" |
| 54 | + $mount_title = $mount_device |
| 55 | + $fixed_mountpath = "swap_${mount_device}" |
44 | 56 | $fixed_pass = 0 |
45 | 57 | $fixed_dump = 0 |
46 | 58 | $mount_ensure = $ensure ? { |
47 | 59 | 'absent' => absent, |
48 | 60 | default => present, |
49 | 61 | } |
50 | 62 | } else { |
51 | | - $mount_title = $mountpath |
| 63 | + $mount_title = $mount_device |
52 | 64 | $fixed_mountpath = $mountpath |
53 | 65 | $fixed_pass = $pass |
54 | 66 | $fixed_dump = $dump |
|
96 | 108 | filesystem { $lvm_device_path: |
97 | 109 | ensure => $ensure, |
98 | 110 | fs_type => $fs_type, |
99 | | - options => $mkfs_options, |
| 111 | + options => "${mkfs_label}${mkfs_options}", |
100 | 112 | } |
101 | 113 | } |
102 | 114 |
|
|
113 | 125 | mount { $mount_title: |
114 | 126 | ensure => $mount_ensure, |
115 | 127 | name => $fixed_mountpath, |
116 | | - device => $lvm_device_path, |
| 128 | + device => $mount_device, |
117 | 129 | fstype => $fs_type, |
118 | 130 | options => $options, |
119 | 131 | pass => $fixed_pass, |
|
0 commit comments