Open ba0f3 opened 2 years ago
This might be more tricky, since "device" is built into the module in some more places (see also the usage of lsblk
).
I think I was looking for the same feature. I saw this: http://freesoftwaremagazine.com/articles/create_encrypted_disk_image_gnulinux/
Which makes a luks virtual volume from an .iso file. Tried to do this with ansible using luks_device
, but only device
is accepted.
One useful bit needed to implement this is losetup -j /path/to/file --output name
. (I would prefer to use --json
instead of parsing the text output, but that's not supported on CentOS 6 and 7, for example; it was only added in June 2015 in https://github.com/util-linux/util-linux/commit/4827093d4b3090389ae0cabb7d8b522cf794ef90.)
LUKS is able to create/open a disk image/ file, so please add disk image supports by add
S_ISREG
checking herehttps://github.com/ansible-collections/community.crypto/blob/d0d99c31b0001f3df9828cace1e5b0f176c0b04f/plugins/modules/luks_device.py#L887