---
- name: Reboot if required
  tags:
    - reboot
    - ubuntu
  when: reboot_ubuntu
  block:
    - name: Stat /var/run/reboot-required
      ansible.builtin.stat:
        path: /var/run/reboot-required
      register: stat_reboot_required

    - name: Notify reboot handler
      become: true
      ansible.builtin.setup: ~
      notify:
        - Reboot node
      when:
        - ansible_distribution == "Ubuntu"
        - stat_reboot_required.stat.exists
...
