# ERROR! The requested handler 'Reboot host' was not found

**URL:** <https://forum.ansible.com/t/error-the-requested-handler-reboot-host-was-not-found/41551>\
**Category:** Get Help\
**Tags:** ansible-lint\
**Created:** [April 6, 2025, 6:34pm UTC](https://forum.ansible.com/t/error-the-requested-handler-reboot-host-was-not-found/41551 "2025-04-06T18:34:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DengelFred](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@DengelFred](https://forum.ansible.com/u/DengelFred)\
**Post date:** [April 6, 2025, 6:34pm UTC](https://forum.ansible.com/t/error-the-requested-handler-reboot-host-was-not-found/41551/1 "2025-04-06T18:34:26Z")

</div>

Hello,

I have a weired issue and I have no idea what could be the issue. Ansible-lint did report nothing.

```shell
$ pipenv run ansible-playbook plays_prod/70_update_homelab.yml

PLAY [Update Proxmox Cluster] ******************************************************************************************

TASK [Gathering Facts] *************************************************************************************************
ok: [pve1]

TASK [Run updates] *****************************************************************************************************
ERROR! The requested handler 'Reboot host' was not found in either the main handlers list nor in the listening handlers list

```

```yaml
# code: language=ansible

- name: Update Proxmox Cluster
  hosts: proxmox_nodes, &managed
  gather_facts: true
  serial: 1

  module_defaults:
    group/community.general.proxmox:
      api_host: "{{ proxmox_api_host }}"
      api_user: "{{ proxmox_api_user }}"
      api_token_id: "{{ proxmox_api_token_id }}"
      api_token_secret: "{{ proxmox_api_token_secret }}"
      validate_certs: true

    ansible.builtin.shell:
      executable: /bin/bash # ansible-lint expects the pipefail option, which is available in bash only

  tasks:
    - name: Run updates
      ansible.builtin.apt:
        upgrade: dist
        update_cache: true
      register: result
      changed_when: true # For testing the handler
      notify: Reboot host

  handlers:
    - name: Reboot host
      block:
        - name: Check HA status
          ansible.builtin.command:
            cmd: ha-manager status
          register: result
          failed_when: "'maintenance mode' in result.stdout"
          changed_when: false

        - name: Enable maintainance mode
          ansible.builtin.command:
            cmd: ha-manager crm-command node-maintenance enable {{ inventory_hostname_short }}
          changed_when: false

        - name: Wait for maintainance mode
          ansible.builtin.shell:
            cmd: |
              set -o pipefail
              ha-manager status | grep '^lrm {{ inventory_hostname_short }}'
          register: result
          until: "'maintenance mode' in result.stdout"
          retries: 60
          delay: 5
          changed_when: false

        - name: Wait for guest migration
          ansible.builtin.shell:
            cmd: |
              set -o pipefail
              ha-manager status | grep '^service'
          register: result
          until: inventory_hostname_short not in result.stdout
          retries: 60
          delay: 5
          changed_when: false

        - name: Reboot
          when: "'/var/run/reboot-required' is file"
          ansible.builtin.reboot:
            reboot_timeout: 600

        - name: Deactivate maintenance mode
          ansible.builtin.command:
            cmd: ha-manager crm-command node-maintenance disable {{ inventory_hostname_short }}
          changed_when: false

        - name: Wait for maintenance mode deactivation
          ansible.builtin.shell:
            cmd: |
              set -o pipefail
              ha-manager status | grep '^lrm {{ inventory_hostname_short }}'
          register: result
          until: "('idle' in result.stdout) or ('active' in result.stdout)"
          retries: 60
          delay: 5
          changed_when: false

# ... two more plays, without handlers

```

This was working until last week. I have no idea what changed in between (According to git, I only updated the “hosts” line, but it worked before I commited)

Maybe anyone have an idea…

Thanks a lot!  
Thomas

---

<div class="post-metadata">

**Author:** ![mkrizek](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mkrizek/32/2055_2.png) [@mkrizek](https://forum.ansible.com/u/mkrizek)\
**Post date:** [April 7, 2025, 7:58am UTC](https://forum.ansible.com/t/error-the-requested-handler-reboot-host-was-not-found/41551/2 "2025-04-07T07:58:57Z")

</div>

`block` cannot be used as a handler. You would need to include all tasks within the “Reboot host” block into a separate file and have a handler like below to achieve such functionality:

```yaml
handlers:
  - name: Reboot host
    include_tasks: reboot_host_tasks.yml

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 7, 2025, 7:59am UTC](https://forum.ansible.com/t/error-the-requested-handler-reboot-host-was-not-found/41551/3 "2025-05-07T07:59:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
