Updates disk mount to use UUID instead of device name

During a demo we saw an issue where after a reboot device names changed which caused problems with the filesystem, see https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/14034

By default Ansible's mount uses device name, this updates it to use UUID, which uses blkid to get it from the device name (standard on Ubuntu, Redhat).

This change is not destructive, when run on a system that was previously using device names /etc/fstab will be update.

Before:

# cat /etc/fstab
LABEL=cloudimg-rootfs	/	 ext4	defaults	0 1
LABEL=UEFI	/boot/efi	vfat	umask=0077	0 1
/dev/disk/by-id/google-log /var/log/gitlab ext4 discard,defaults 0 0
/dev/disk/by-id/google-data /var/opt/gitlab ext4 discard,defaults 0 0

After:

# cat /etc/fstab
LABEL=cloudimg-rootfs	/	 ext4	defaults	0 1
LABEL=UEFI	/boot/efi	vfat	umask=0077	0 1
UUID=ec35884d-bec2-4702-9975-c88cbc87e4b2 /var/log/gitlab ext4 discard,defaults 0 0
UUID=d2b6720c-cb22-44c0-aa9a-fd03851bbba9 /var/opt/gitlab ext4 discard,defaults 0 0

Merge request reports

Loading