# "Reboot" task no longer reconnects or times out

**URL:** <https://forum.ansible.com/t/reboot-task-no-longer-reconnects-or-times-out/10483>\
**Category:** Get Help\
**Created:** [October 24, 2024, 6:53am UTC](https://forum.ansible.com/t/reboot-task-no-longer-reconnects-or-times-out/10483 "2024-10-24T06:53:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maspital](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/maspital/32/4792_2.png) [@Maspital](https://forum.ansible.com/u/Maspital)\
**Post date:** [October 24, 2024, 6:53am UTC](https://forum.ansible.com/t/reboot-task-no-longer-reconnects-or-times-out/10483/1 "2024-10-24T06:53:17Z")

</div>

Hi,

We’ve been using ansible (combined with packer) to automatically provision a bunch of VMs to form a small company network usable for attack testing (in [this little project](https://github.com/fkie-cad/socbed)).

This worked fine, until I upgraded one of the machines to a later OS version (IPFire 2.25 core141 → core 157), causing ansible to no longer reconnect after a `reboot` task in this simple role:

```yml
- name: Copy suricata configuration files
  copy:
    src: "{{ item }}"
    dest: "/var/ipfire/suricata/"
  with_fileglob:
    - "files/suricata/configs/*"

- name: Unarchive suricata rule files to cr
  unarchive:
    src: "files/suricata/rules.tar.xz"
    dest: "/var/lib/suricata/"

- name: Add syslog output to /etc/suricata/suricata.yaml
  lineinfile:
    path: "/etc/suricata/suricata.yaml"
    insertafter: "^outputs:"
    line: " # Output alerts to syslog\n - syslog:\n enabled: yes\n facility: local5\n"

- name: Reboot after suricata config
  reboot:
    reboot_timeout: 180

```

What’s odd about this is that it also does not trigger the 180s timeout (i.e., the task runs forever until it’s eventually killed by the supervising script. I know that the timeout can potentially be double that number, but it also runs longer than that). When checking the VM in question manually, ssh is also up and running. I’m asking this here because I have absolutely no idea how to debug this - while the overall cause is obviously the version upgrade, I suspect that the actual reason is not a bug but rather some change I’m simply not aware of.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [October 29, 2024, 1:13pm UTC](https://forum.ansible.com/t/reboot-task-no-longer-reconnects-or-times-out/10483/2 "2024-10-29T13:13:47Z")

</div>

Did you try using verbose logging and seeing if any of the task output helps? `-vvvvv`

Next you could look at the module docs/code and see if anything seems like it would need tweaking for your OS.  
[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/reboot\_module.html](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/reboot_module.html)

> <https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/reboot.py>

Finally, you could try a workaround.  
Run the reboot task async, and then use the `wait_for` module to check for SSH access

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [November 4, 2024, 3:48pm UTC](https://forum.ansible.com/t/reboot-task-no-longer-reconnects-or-times-out/10483/3 "2024-11-04T15:48:51Z")

</div>

> [@Maspital](#):
>
> What’s odd about this is that it also does not trigger the 180s timeout (i.e., the task runs forever until it’s eventually killed by the supervising script. I know that the timeout can potentially be double that number, but it also runs longer than that).

That bit seems like a bug, what version of `ansible-core` is installed? If you use `-vvv`, the reboot task should include some clues about what’s happening.
