Googling your error yielded Ansible.legacy.setup failed to execute so it may also be worth posting information about the target’s OS version and what version of Python is running there, as well as your version of Ansible on top of what the other people have asked for in this thread.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Ansible.legacy.setup failed to execute | 3 | 30016 | July 19, 2024 | |
| [Playbook] - CentOS - module FAILED "The following modules failed to execute: ansible.legacy.setup" | 5 | 125 | September 20, 2025 | |
| Getting failed to execute: ansible.legacy.setup | 1 | 2775 | June 6, 2021 | |
| Ansible command succeeded but playbook failed | 1 | 9 | February 5, 2016 | |
| apt module has error "failed to execute setup | 3 | 43 | July 31, 2019 |