Execution
Date 16 Sep 2025 09:38:16 +0100
Duration 00:03:33.23
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.3 / 1.7.3
Python 3.10.10
Summary
399 Hosts
3 Tasks
1191 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/RM10132_kvm_restart_required.yaml

---
- name: Process KVM Hosts That Require Restart
  hosts: all
  gather_facts: false

  tasks:
    - name: Check if system needs restarting
      kvm_upgrade_utils:
        action: check_restart
      register: restart_status

    - name: Display hosts requiring restart
      ansible.builtin.debug:
        msg: |
          🚨 {{ inventory_hostname }}: RESTART REQUIRED
      when: restart_status.needs_restarting
      changed_when: true

    - name: Display hosts not requiring restart
      ansible.builtin.debug:
        msg: "✅ {{ inventory_hostname }}: No restart needed"
      when: not restart_status.needs_restarting
      changed_when: false