ansible.builtin.setup does not list partition uuid

Hello,

I am using ansible to setup a machine, after booting it via a usb drive. In my plays I obviously have to partition the disk as needed. For this, I am using community.general.parted without any trouble.

After partitioning the disk, formatting and mounting the partitions I write to them what is needed. No problem.

Once all is done, I go on to update fstab. For this, I need the partitions UUIDs in order to get a reliable fstab, using device name is not reliable… So I run ansible.builtin.setup to update the facts. Sometime it works, but most of the time the UUID is missing for 1 or more of the partitions.

Sure enough, if I log into the machine, I see that /dev/disk/by-uuid is missing the partition in question. But blkid do list the uuid for that partition so the kernel is well aware of the uuid.

The link in /dev/disk/by-uuid are, according to Google, setup by udevd. I could hunt that side of the equation and try to fix this. I have used partprobe without success. I unmounted and remounted the partition also without success. I suspect that trying to fix what udevd is supposed to do is not going to help me. On the other hand, having a reliable ansible.builtin.setup is probably a good thing to have in general. Is it possible to have it use blkid instead. Or something else?