Problem: 2.14.x fails to find installed galaxy modules
Issue
After upgrading from 2.13.x to 2.14.x, my project no longer sees the installed galaxy modules and does not reinstall them, as it reports my requirements.yml has no changes.
/opt/semaphore/project_3/repository_7_template_51/roles/requirements.yml has no changes. Skip galaxy install process.
Therefore my tasks all fail to run.
ERROR! couldn't resolve module/action 'ansible.posix.selinux'. This often indicates a misspelling, missing collection, or incorrect module path.
Prior to upgrade, these tasks ran correctly on version 2.13.12. It seems like the issue might be related to the new directory structure.
Impact
Ansible (task execution)
Installation method
Binary
Database
MySQL
Browser
No response
Semaphore Version
2.14.6-989740f-1745939232
Ansible Version
ansible [core 2.16.0]
config file = None
configured module search path = ['/opt/semaphore/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
ansible collection location = /opt/semaphore/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.11.11 (main, Dec 12 2024, 16:28:23) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/usr/bin/python3.11)
jinja version = 3.1.4
libyaml = True
# /opt/semaphore/.ansible/collections/ansible_collections
Collection Version
----------------- -------
ansible.posix 2.0.0
community.general 10.6.0
community.mysql 3.13.0
Logs & errors
No response
Manual installation - system information
No response
Configuration
No response
Additional information
No response
Debug shows that ansible-playbook is looking for modules in the project directory, rather than /opt/semaphore/.ansible:
ansible-playbook [core 2.16.0] config file = None configured module search path = ['/opt/semaphore/project_3/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.11/site-packages/ansible ansible collection location = /opt/semaphore/project_3/.ansible/collections:/usr/share/ansible/collections
I worked around the issue for now by manually installing the galaxy modules into the directory where ansible-playbook is looking:
ansible-galaxy collection install ansible.posix -p /opt/semaphore/project_3/.ansible/collections/ --force
Hi @jfronza thanks a lot. I trying reproduce the issue.
Hi, I have been facing similar issues regarding the new tmp_path feature. All semaphore runs seem to use the project_x dir as working directory. I have installed ansible locally in a unix user making the python search path for the site-packages invalid as it now includes the project_x dir. A workaraound is to put a symlink into the project_x folders.
@nfsprodriver yes, that is true. I have no idea how to change this behavior and preserve backward compatibly. Let me know if you have any idea.