testing block devices with molecule

16 views
Skip to first unread message

darren....@gmail.com

unread,
Jan 15, 2020, 11:13:33 AM1/15/20
to molecule-users
Hi All,

I've just started using molecule for building/testing some of our ansible roles - loving it so far!. The first role I'm working on involves discovering/partitioning/formatting/mounting a disk on the target host. 

I'm trying to prepare the molecule docker instances (I'm testing across 3 OSes) using loopback devices to fakeout the disk so that I can test mounting/partitioning etc. However, clearly block devices are inherited from the host on which docker is running, and so this is getting a bit messy - even unmounting and cleaning up the loopback devices in docker does not clean them up on the host. And trying to test 3 instances at a time means I can't use the same loopback device, so setting the vars that define the block device name to use for the role is also somewhat difficult as I can't discover them and then pass the device name through to the actual role when it runs (or can I?)

Basically, my question is: is there an easier way to test interaction with block devices using molecule/docker ?

Thanks!
Darren
Reply all
Reply to author
Forward
0 new messages