Why doesn't this task to check when a server has booted work?

I have an Ansible playbook for creating Linode servers. The problem I’m having is that my playbook isn’t able to determine when the new server is up. I’m using Ansible 2.8.4. My playbook is as follows:

Hi,

You should probably use "wait_for_connection" module instead of the one you use

This is how I use it :

- hosts: newly_managed_vms
become: yes
become_user: root
remote_user: ansible
gather_facts: no # servers could be not available yet
tasks:

- name: "Wait for server to power up"
wait_for_connection:
sleep: 5
timeout: 600

- name: "Gather facts for first time"
setup:

Regards,

JYL

Thanks Jean-Yves!