# Trouble with simple ansible.builtin.reboot

**URL:** <https://forum.ansible.com/t/trouble-with-simple-ansible-builtin-reboot/4180>\
**Category:** Get Help\
**Tags:** playbook, ubuntu, ansible-core\
**Created:** [March 2, 2024, 12:34am UTC](https://forum.ansible.com/t/trouble-with-simple-ansible-builtin-reboot/4180 "2024-03-02T00:34:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![go140point6](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@go140point6](https://forum.ansible.com/u/go140point6)\
**Post date:** [March 2, 2024, 12:34am UTC](https://forum.ansible.com/t/trouble-with-simple-ansible-builtin-reboot/4180/1 "2024-03-02T00:34:35Z")

</div>

Feel a little silly even having to post this but I can’t get the ansible.builtin.reboot working. It reboots the target no problem, and I’m able to log back in via ssh within 5-10 seconds but the play always fails with:

“msg: Timed out waiting for last boot time check” no matter how long I wait.

ansible [core 2.15.9]

I’ve isolated the task to a single reboot operation like this:

```auto
---
- name: Reboot Ubuntu system
  hosts: vps-sandbox01
  gather_facts: false
  become: true

  tasks:
    - name: Reboot the system
      ansible.builtin.reboot:
        reboot_timeout: 30
      ignore_errors: true

```

Should this work? My other playbooks do updates, running commands that require elevated privileges, etc so I fairly certain my setup is correct. I’m using a non-standard ssh port and an ssh key for my user “ansible”, all directly defined in the /etc/ansible/hosts file:

```auto
vps-sandbox01 ansible_host=111.111.111.111 ansible_user=ansible ansible_port=12345 ansible_ssh_private_key_file=/home/jojo/.ssh/ansible/id_ed25519.key

```

I’m at a loss. When i use -vvv I’m seeing some things that seem odd to me, this is repeated until the connection is closed (when the play reports back failed I guess):

```auto
No connection to reset: No ControlPath specified for "-O" command
ansible.builtin.reboot: attempting to get system boot time
<111.111.111.111> ESTABLISH SSH CONNECTION FOR USER: ansible
<111.111.111.111> SSH: EXEC ssh -o StrictHostKeyChecking=accept-new -o Port=12345 -o 'IdentityFile="/home/jojo/.ssh/ansible/id_ed25519.key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -tt 111.111.111.111 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-tolopbdpehfcyipeyhwqkwahklprjpud ; cat /proc/sys/kernel/random/boot_id'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<111.111.111.111> (255, b'', b'ssh: connect to host 111.111.111.111 port 12345: No route to host\r\n')

```

Any ideas where I’m going wrong?

---

<div class="post-metadata">

**Author:** ![go140point6](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@go140point6](https://forum.ansible.com/u/go140point6)\
**Post date:** [March 4, 2024, 11:07pm UTC](https://forum.ansible.com/t/trouble-with-simple-ansible-builtin-reboot/4180/2 "2024-03-04T23:07:03Z")

</div>

Well, it ended up being that particular host. I switched to another host and reboot worked exactly as one would expect… 🤦‍♂️

That particular host uses openvz virtualization and I’ve had weird issues with it before, most of my hosts use kvm. I should have checked that before posting but I guess I was too far in the weeds.
