Execution
Date 29 Oct 2025 14:19:56 +0000
Duration 00:05:34.18
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.3 / 1.7.3
Python 3.10.10
Summary
399 Hosts
5 Tasks
1978 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/RM10179-create-fpm-error-report.yaml

---
- name: Check with the script for errors
  hosts: all
  gather_facts: false
  tasks:
    - name: Get server info
      plesk_info:
      register: plsk
    - name: On plesk server execute block
      when: plsk.plesk_found
      block:
        - name: Upload script
          ansible.builtin.copy:
            src: find_fpm_errors.sh
            dest: /root/find_fpm_errors.sh
            mode: '0755'
          changed_when: false
        - name: Execute the script
          ansible.builtin.shell: |
            set -o pipefail
            /root/find_fpm_errors.sh "{{ type }}"
          args:
            executable: /bin/bash
          register: script_out
          changed_when: script_out.stdout | length > 0
        - name: Create human-readable output for each host
          when: script_out.stdout | length > 0
          ansible.builtin.template:
            src: alt_php_errors.j2
            dest: "RM10179-files/alt-php-errors-{{ inventory_hostname }}.txt"
            mode: '0644'
          vars:
            hostname: inventory_hostname
            script_output: script_out.stdout
          delegate_to: 127.0.0.1
          changed_when: false
        - name: Save host-specific error summary
          when: script_out.stdout | length > 0
          ansible.builtin.lineinfile:
            path: "/home/ssh-gateway/ansible/kuly/alt-php-fpm-errors-{{ type }}.txt"
            line: "{{ inventory_hostname }} - has problematic PHP handlers"
            create: true
            mode: '0644'
          delegate_to: 127.0.0.1