File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 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 ],
40
52
41
53
if $fs_type == ' swap' {
42
54
$mount_title = $lvm_device_path
43
- $fixed_mountpath = " swap_${lvm_device_path } "
55
+ $fixed_mountpath = " swap_${mount_device } "
44
56
$fixed_pass = 0
45
57
$fixed_dump = 0
46
58
$mount_ensure = $ensure ? {
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 ,
You can’t perform that action at this time.
0 commit comments