Execution
Date 09 Sep 2024 15:23:40 +0100
Duration None
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.4
ara 1.7.1 / 1.7.1
Python 3.10.10
Summary
137 Hosts
7 Tasks
625 Results
2 Plays
11 Files
0 Records

File: /home/ssh-gateway/ansible/roles/imunify360/tasks/main.yml

---
# tasks file for imunify360-agent
- name: Check imunify360-agent binary and run health commands if binary exists
  ansible.builtin.shell: |
    if [[ -f /usr/bin/imunify360-agent ]]; then
      if imunify360-agent health | grep -q "OK"; then
        imunify360-agent health --json
      else
        echo "Not OK"
      fi
    else
      echo "Binary not found"
    fi
  args:
    executable: /bin/bash
  register: imunify_health_json
  changed_when: false

- name: Set imunify_found fact based on command result
  ansible.builtin.set_fact:
    imunify_found: "{{ 'OK' in imunify_health_json.stdout }}"
  when: "'OK' in imunify_health_json.stdout"