Execution
Date 23 Jan 2026 07:24:31 +0000
Duration 00:03:16.28
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.4 / 1.7.4
Python 3.10.10
Summary
396 Hosts
3 Tasks
1180 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/zz-find-alt-logs.yaml

---
- name: Playbook to upload logrotates
  hosts: all
  gather_facts: false
  vars:
    search_dir: /var/log
  tasks:
    - name: Get plesk info
      plesk_info:
      register: plsk
    - name: On plesk with imunify or cl
      when: (plsk.plesk_found and plsk.imunify_found) or (plsk.plesk_found and plsk.cloudlinux_found)
      block:
        - name: Find files
          ansible.builtin.find:
            paths: "{{ search_dir }}"
            patterns: "alt-php*-*.log.*"
            file_type: file
            size: 1g
            recurse: true
          register: large_log_files
        - name: Show found large files
          ansible.builtin.debug:
            msg: "Found large file: {{ item.path }} ({{ item.size | filesizeformat }})"
          loop: "{{ large_log_files.files }}"
          when: large_log_files.files | length > 0
          changed_when: large_log_files.files | length > 0