fix(ansible): set collections_path to /opt/ansible-collections in ansible.cfg

Semaphore clones the repo and runs ansible-playbook from the working
directory, so ansible.cfg is loaded automatically. This is more
reliable than env vars inherited through podman exec subprocesses.

/opt/ansible-collections is bind-mounted into the container and
populated by the semaphore role's collections task.
This commit is contained in:
Hermes Agent service account
2026-06-07 16:58:25 -05:00
parent d1ae5ba7a0
commit e793794fdd

View File

@@ -54,7 +54,7 @@
# (pathspec) Colon-separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``'{{ ANSIBLE_HOME ~ "/collections" }}'``, and you want to add ``my.collection`` to that directory, it must be saved as ``'{{ ANSIBLE_HOME} ~ "/collections/ansible_collections/my/collection" }}'``. # (pathspec) Colon-separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``'{{ ANSIBLE_HOME ~ "/collections" }}'``, and you want to add ``my.collection`` to that directory, it must be saved as ``'{{ ANSIBLE_HOME} ~ "/collections/ansible_collections/my/collection" }}'``.
;collections_path=/Users/rblundon/.ansible/collections:/usr/share/ansible/collections collections_path=/opt/ansible-collections:/usr/share/ansible/collections
# (boolean) A boolean to enable or disable scanning the sys.path for installed collections. # (boolean) A boolean to enable or disable scanning the sys.path for installed collections.
;collections_scan_sys_path=True ;collections_scan_sys_path=True