Skip to content

Problem: 2.14.x fails to find installed galaxy modules #2988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jfronza opened this issue May 1, 2025 · 4 comments
Open

Problem: 2.14.x fails to find installed galaxy modules #2988

jfronza opened this issue May 1, 2025 · 4 comments
Assignees
Labels
ansible Issues related to Ansible
Milestone

Comments

@jfronza
Copy link

jfronza commented May 1, 2025

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
Copy link
Author

jfronza commented May 1, 2025

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
Copy link
Author

jfronza commented May 1, 2025

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

@fiftin
Copy link
Collaborator

fiftin commented May 2, 2025

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

@fiftin fiftin self-assigned this May 2, 2025
@fiftin fiftin added the ansible Issues related to Ansible label May 2, 2025
@fiftin fiftin added this to Bugfixing May 2, 2025
@fiftin fiftin added this to the 2.14 milestone May 2, 2025
@nfsprodriver
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible Issues related to Ansible
Projects
Status: No status
Development

No branches or pull requests

3 participants