Execution
Date 18 Mar 2024 12:24:45 +0000
Duration 00:00:04.78
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.4
ara 1.7.1 / 1.7.2.dev2
Python 3.10.10
Summary
10 Hosts
2 Tasks
20 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/check-kcare.yaml

---
- name: Check if agent360 service is running
  hosts: all
  gather_facts: true

  tasks:
    - name: Check if agent360 service is running
      command: systemctl is-active agent360
      register: agent360_status
      ignore_errors: true

    - name: Display alert message if agent360 service is not running
      debug:
        msg: "Agent360 service is not running on {{ ansible_hostname }}!"
      when: agent360_status.rc != 0