Execution
Date 25 Sep 2024 12:40:12 +0100
Duration 00:02:40.25
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
166 Hosts
9 Tasks
1388 Results
1 Plays
11 Files
0 Records

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

---
- name: Playbook to check if there is a leftover cron as per RM9718
  hosts: all
  gather_facts: false
  roles:
    - plesk
    - imunify360
  tasks:
    - name: Check if imunify360 cron exists
      when: plesk_found and imunify_found
      ansible.builtin.shell: |
        set -o pipefail
        ls -la /etc/cron.d/imunify360-firewall-update
      args:
        executable: /bin/bash
      register: imout
      changed_when: false
      failed_when: imout.rc not in [0, 2]

    - name: Save missing cron servers to file
      when: imout is defined and imout.rc == 2
      ansible.builtin.lineinfile:
        path: /home/ssh-gateway/ansible/kuly/missing-im
        line: "{{ ansible_hostname }}"
        create: true
        mode: '0644'
      delegate_to: 127.0.0.1