ansible/ansible — pull request #7263 by ajsalminen (2014-05-03 08:21:36+00:00)
Title: Switch to mapper device name if pvs returns the wrong one.

The lvg module fails after the initial run if the pvs parameter includes device-mapper logical volumes on some older distributions such as Debian Squeeze and Ubuntu 12.04. This issue is encountered when using LVM on LUKS for example.

The issue is caused because on these distro versions "pvs" returns the non-persistent device names like /dev/dm-0 for device-mapper logical volumes. This makes lvg to think the device has not yet been added to the volume group/initialized while in reality it has.

The proposed patch would use dmsetup to find out what the device name is when encountering /dev/dm- prefixed device names in the list from "pvs". This will allow using /dev/mapper/name but not /dev/vg/name in the pvs parameter.