Execution
Date 23 Jul 2025 08:20:51 +0100
Duration 00:03:19.02
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.2 / 1.7.2
Python 3.10.10
Summary
399 Hosts
3 Tasks
1194 Results
1 Plays
1 Files
0 Records

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

---
- name: Repair Imunify
  hosts: all
  gather_facts: false

  tasks:
    - name: Get Plesk info
      plesk_info:
      register: pl

    - name: Check Imunify license and trigger repair if invalid
      ansible.builtin.debug:
        msg: "Imunify license is not valid (status: {{ pl.imunify_license_status }}), triggering repair..."
      when: pl.plesk_found and pl.imunify_found and not pl.imunify_license_valid
      changed_when: true

    - name: Save to a file
      ansible.builtin.lineinfile:
        path: /home/ssh-gateway/ansible/kuly/repair_imunify.txt
        create: true
        mode: '0644'
        line: "{{ inventory_hostname }}"
      when: pl.plesk_found and pl.imunify_found and not pl.imunify_license_valid
      delegate_to: 127.0.0.1