Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ The following parameters are available in the `lvm::logical_volume` defined type
* [`dump`](#-lvm--logical_volume--dump)
* [`fs_type`](#-lvm--logical_volume--fs_type)
* [`mkfs_options`](#-lvm--logical_volume--mkfs_options)
* [`use_dm_devicepath`](#-lvm--logical_volume--use_dm_devicepath)
* [`mountpath`](#-lvm--logical_volume--mountpath)
* [`mountpath_require`](#-lvm--logical_volume--mountpath_require)
* [`mounted`](#-lvm--logical_volume--mounted)
Expand Down Expand Up @@ -198,6 +199,14 @@ Data type: `Optional[String[1]]`

Default value: `undef`

##### <a name="-lvm--logical_volume--use_dm_devicepath"></a>`use_dm_devicepath`

Data type: `Boolean`

Whetever to use the default /dev/$vg/$lv as device name or use /dev/mapper/$vg-$lv for mount and filesystem creation.

Default value: `false`

##### <a name="-lvm--logical_volume--mountpath"></a>`mountpath`

Data type: `Stdlib::Absolutepath`
Expand Down
10 changes: 9 additions & 1 deletion manifests/logical_volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#
# @param mkfs_options
#
# @param use_dm_devicepath Whetever to use the default /dev/$vg/$lv as device name or use /dev/mapper/$vg-$lv for mount and fs creation (Default value: false)
#
# @param mountpath
#
# @param mountpath_require
Expand Down Expand Up @@ -72,6 +74,7 @@
Variant[String[1], Integer] $dump = '0',
String[1] $fs_type = 'ext4',
Optional[String[1]] $mkfs_options = undef,
Boolean $use_dm_devicepath = false,
Stdlib::Absolutepath $mountpath = "/${name}",
Boolean $mountpath_require = false,
Boolean $mounted = true,
Expand All @@ -92,7 +95,12 @@
Optional[Enum['anywhere', 'contiguous', 'cling', 'inherit', 'normal']] $alloc = undef,
Boolean $yes_flag = false,
) {
$lvm_device_path = "/dev/${volume_group}/${name}"
# Do not respect for swap, to have a stable mount_title
if $use_dm_devicepath and $fs_type != 'swap' {
$lvm_device_path = "/dev/mapper/${volume_group}-${name}"
} else {
$lvm_device_path = "/dev/${volume_group}/${name}"
}

if $mountpath_require and $fs_type != 'swap' {
Mount {
Expand Down