Execution
Date 03 Nov 2025 12:12:00 +0000
Duration 00:04:53.17
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
4 Tasks
1584 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/zz-rm10179-check-for-php-errors.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: zz-rm10179-check-for-php-errors.sh
            dest: /root/zz-rm10179-check-for-php-errors.sh
            mode: '0755'
          changed_when: false
        - name: Execute the script
          ansible.builtin.shell: |
            set -o pipefail
            /root/zz-rm10179-check-for-php-errors.sh
          args:
            executable: /bin/bash
          register: script_out
          changed_when: script_out.stdout | length > 0
        - name: Display errors if found
          when: script_out.stdout | length > 0
          ansible.builtin.lineinfile:
            path: "/home/ssh-gateway/ansible/kuly/zz-rm10179-check-for-php-errors.txt"
            line: "{{ inventory_hostname }} - fpm error on {{ script_out.stdout_lines }}"
            create: true
            mode: '0644'
          delegate_to: 127.0.0.1