Execution
Date 25 Feb 2026 10:07:00 +0000
Duration 00:03:10.96
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.13
ara 1.7.4 / 1.7.4
Python 3.10.10
Summary
398 Hosts
3 Tasks
1189 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/ansible-luca/alt-php-checker.yaml

---
- name: RM10252 - PHP EOL Checker
  hosts: all
  gather_facts: false

  tasks:
    - name: Get Info
      plesk_info:
      register: plsk

    - name: Check for both alt/plesk-php84 and alt/plesk-php85 handlers
      ansible.builtin.shell: |
        set -o pipefail
        handlers="$(plesk bin php_handler --list)"
        echo "$handlers" | grep -q 'alt-php84' && echo "$handlers" | grep -q 'alt-php85' && echo "$handlers" | grep -q 'plesk-php84' && echo "$handlers" | grep -q 'plesk-php85'
      args:
        executable: /bin/bash
      register: php_check
      when: (plsk.plesk_found and plsk.imunify_found) or (plsk.plesk_found and plsk.cloudlinux_found)
      changed_when: false
      failed_when: false

    - name: Record servers missing alt/plesk-php84 or alt/plesk-php85
      ansible.builtin.lineinfile:
        create: true
        mode: '0644'
        path: RM10252/hostnames
        line: "{{ inventory_hostname }}"
      when: 
        - php_check is defined
        - php_check.rc != 0
      delegate_to: localhost