Execution
Date 15 Sep 2025 16:25:56 +0100
Duration 00:02:43.90
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
2 Tasks
795 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/zz-needs-restarting.yaml

---
- name: Check if servers need restarting using custom module
  hosts: all
  gather_facts: false

  tasks:
    - name: Check if system needs restarting
      needs_restarting_check:
      register: restart_status

    - name: Display restart status
      ansible.builtin.debug:
        msg: |
          {% if restart_status.needs_restarting %}
          ⚠️  Server REQUIRES a restart
          {% else %}
          ✅ Server does NOT need a restart
          {% endif %}
      changed_when: restart_status.needs_restarting