I’ve published a (very simple) playbook for this some years ago: baremetalesxi
I didn’t have the time to keep this up to date and I don’t know if it still works. But maybe this helps you to get started.
We’re still using a (very much evolved) version of this to install ESXi hosts. But this is where we started.