What entry is in your inventory host file? Is it IP address, short hostname, fqdn?
The following variables are valid in your playbook, and the 'right' one depends on your environment.
ansible_fqdn, ansible_hostname, inventory_hostname, inventory_hostname_short
The ansible_fqdn and ansible_hostname are facts determined at the remote host. Inventory_hostname and inventory_hostname_short are parsed from your Ansible inventory file.
For instance, in your current playbook, if you have an entry for the reboot target of dbserver, and for some reason the 'dbserver' node reports its fqdn as
webserver.example.org then your reboot command will wait for
webserver.example.org:22 to be available, which may not resolve from your Ansible management node.
Given that Ansible has no problem connecting using the value in your inventory file, you might start with inventory_hostname which will use the entry in your inventory file.