{"id":7762,"sha1":"b61894e1f964e84fa2ec900f59ee79b6a6506813","playbook":{"id":5603,"items":{"plays":1,"tasks":1,"results":55,"hosts":56,"files":1,"records":0},"arguments":{"version":null,"verbosity":0,"private_key_file":"/home/ssh-gateway/.ssh/id_rsa","remote_user":"root","connection":"ssh","timeout":null,"ssh_common_args":null,"sftp_extra_args":null,"scp_extra_args":null,"ssh_extra_args":null,"ask_pass":false,"connection_password_file":null,"force_handlers":false,"flush_cache":false,"become":false,"become_method":"sudo","become_user":null,"become_ask_pass":false,"become_password_file":null,"tags":["all"],"skip_tags":[],"check":false,"diff":false,"inventory":["/home/ssh-gateway/ansible/kuly/bash-kvm-inventory-prod.sh"],"listhosts":false,"subset":null,"extra_vars":"Not saved by ARA as configured by 'ignored_arguments'","vault_ids":[],"ask_vault_pass":false,"vault_password_files":[],"forks":20,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["zz-detect-opcache-issues.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"}],"started":"2026-04-28T07:56:39.046180+01:00","ended":"2026-04-28T07:58:14.227165+01:00","duration":"00:01:35.180985","name":null,"ansible_version":"2.16.13","client_version":"1.7.5","python_version":"3.10.10","server_version":"1.7.5","status":"expired","path":"/home/ssh-gateway/ansible/kuly/zz-detect-opcache-issues.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Detect servers with missing alt-php opcache modules\n  hosts: all\n  gather_facts: false\n  vars:\n    php_versions:\n      - \"54\"\n      - \"55\"\n      - \"56\"\n    affected_versions: []\n\n  tasks:\n    - name: Get server info (optional Plesk check)\n      plesk_info:\n      register: plsk\n      ignore_errors: true\n\n    - name: Check PHP versions for opcache errors\n      when: plsk.plesk_found | default(true)\n      block:\n        - name: Run php -m for each version\n          ansible.builtin.command: \"/opt/alt/php{{ item }}/usr/bin/php -m\"\n          loop: \"{{ php_versions }}\"\n          register: php_checks\n          failed_when: false\n          changed_when: false\n\n        - name: Identify affected versions on this host\n          ansible.builtin.set_fact:\n            affected_versions: \"{{ affected_versions + [item.item] }}\"\n          loop: \"{{ php_checks.results }}\"\n          when: >-\n            item.stderr is defined and\n            'cannot open shared object file' in item.stderr and\n            'opcache.so' in item.stderr\n\n        - name: \ud83d\udea8 Report if any version is affected\n          ansible.builtin.debug:\n            msg: |\n              \u26a0\ufe0f  HOST {{ inventory_hostname }} HAS MISSING OPCACHE:\n              \u2192 Affected PHP versions: {{ affected_versions }}\n              \u2192 Run: dnf install alt-php{{ affected_versions | join(' alt-php') }}-opcache\n          when: affected_versions | length > 0\n          failed_when: true  # \u2190 Makes playbook FAIL for affected hosts (easy to spot in CI/logs)\n\n        - name: \u2705 Report clean host\n          ansible.builtin.debug:\n            msg: \"\u2713 {{ inventory_hostname }}: All checked PHP versions have opcache loaded correctly\"\n          when: affected_versions | length == 0\n","created":"2026-04-28T07:56:39.060593+01:00","updated":"2026-04-28T07:56:39.060613+01:00","path":"/home/ssh-gateway/ansible/kuly/zz-detect-opcache-issues.yaml"}