ESXi upgrade using ansible playbook

This [localhost] means that the task is invoked to localhost instead of your ESXi. You should specify the target node of this task to your ESXi, by changing hosts on your playbook or delegate_to on the task.