Background:
We used Ansible’s Python API to execute Playbook, but recently Ansible is preparing to upgrade from 2.14 to 2.15. When executing Playbook, there will be an error message: No module named \ "Ansible_collections. Ansible. builtin ".
I found during debugging that the difference between 2.14 and 2.15 is that Ansible was not loaded_ Builtin_ Runtime.yml file. I would like to ask everyone how to solve this problem
Here is the code:
playbook = PlaybookExecutor(playbooks=playbook_path,
inventory=inventory,
variable_manager=variable_manager,
loader=loader,
passwords=passwords
)
Are you using ansible-runner? That’s the only public API for running playbooks I’m aware of. If you are using internals of ansible-core you should switch to using ansible-runner.
@jack Did you get any fix for the this issue No module named “ansible_collections.ansible.builtin” ? I am facing the exact same error using PlaybookExecutor. Though I am aware of using public API but just wondering if you found solution for this.