semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Problem: 2.14.x fails to find installed galaxy modules

Open jfronza opened this issue 10 months ago • 4 comments

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

jfronza avatar May 01 '25 18:05 jfronza

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

jfronza avatar May 01 '25 19:05 jfronza

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

jfronza avatar May 01 '25 20:05 jfronza

Hi @jfronza thanks a lot. I trying reproduce the issue.

fiftin avatar May 02 '25 05:05 fiftin

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 avatar May 02 '25 12:05 nfsprodriver

@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.

fiftin avatar Nov 05 '25 18:11 fiftin