Automating VMware migrations

Hello,

I have a playbook that I’m working on to migrate VMs to a new ESX host. I finally got 1 maybe 2 parts working where I can power-off the machine and power-on again. Here’s where the maybe comes into play.
When I run the playbook I can see the VM power-off and immediately power-on again, but let’s say if I were to cut out the power-on task and put it back in there it can’t detect the VM.
I thought something like this would happen because how can ansible re-connect to a powered down host? By the way this is my first time using a tool like ansible and most of this playbook wasn’t running at all… lot’s of errors and mistakes. Haha