Ansible, FreePBX 15, and Python

Hello all,

I have been using Ansible to manage multiple FreePBX 15 boxes. Last week I did an ansible update and since then, I am unable to run commands. The error is below and clearly has something to do with the update and/or python.

TASK [Gathering Facts] *****************************************************************************************************************************************************************************************************************************************************************
fatal: [HOSTNAME HERE]: FAILED! => changed=false
  ansible_facts: {}
  failed_modules:
    ansible.legacy.setup:
      ansible_facts:
        discovered_interpreter_python: /usr/bin/python3
      failed: true
      module_stderr: |-
        Shared connection to HOSTNAME HERE closed.
      module_stdout: |-
        /bin/sh: /usr/bin/python3: No such file or directory
      msg: |-
        The module failed to execute correctly, you probably need to set the interpreter.
        See stdout/stderr for the exact error
      rc: 127
      warnings:
      - No python interpreters found for host HOSTNAME HERE (tried ['python3.12', 'python3.11', 'python3.10', 'python3.9', 'python3.8', 'python3.7', '/usr/bin/python3', 'python3'])
  msg: |-
    The following modules failed to execute: ansible.legacy.setup

How can I get around this error without logging into each FreePBX box manually?

Thanks in advance!

After much trial and error, this article helped. A good read for anyone in a similar situation. (TLDR) downgrading ansible-core to 2.16.3 worked.

https://www.jeffgeerling.com/blog/2024/newer-versions-ansible-dont-work-rhel-8

Perhaps there is a better way?