Let me try to be clearer :
ansible localhost -m setup
Is not showing any block devices :
"ansible_devices": {},
This host is using /dev/nbd0 as its root device.
Now I was wondering, for my particular needs, how I could fill this gathered facts with my block device, for instance I'd like to fake a /dev/sda which would be a loop device. The issue is not about how to create this block device, but how to get it gathered by Ansible?
Thank you for any suggestion.
I guess you can't do this without coding.
Out of the box Ansible drops any block devices with
virtual
in it path. (see code)You can patch this code to include that devices or write your custom module to gather information about block devices.