Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHEA-2018:0700

I faced this problem recently and my /etc/fstab didn't had any entry for /tmp, just the main xfs partition. I am almost sure that setting hostname worked before on the same host and I suspect some recent change may have introduced this issue.
I want to prevent reachign this case again and run some preparatory ansible task(s) before set-hostname is called but I am afraid that touching /etc/fstab may be too dangereus especially as user may have added some other custom /tmp config.
Any ideas detect-and-fix scriptable approach?