Sync problems on the Ansible Galaxy API

Hello, it seems like the galaxy.ansible.com Web API (the one that is the ground-truth for ansible-galaxy) is not getting updates from our role pushes since 2023.

  • what I am attempting to do:
    1. create an empty directory for tests, and cd into it
    2. create a requirements.yml file that contains
      roles:
      - name: epfl_si.ansible_module_openshift
      
    3. run ansible-galaxy role install -vvvvv --force -p . -i -r requirements.yml
  • what I expect to happen: the latest version of epfl_si.ansible_module_openshift (i.e. 1.10.2) should be installed.
  • what happens instead: a stale version (1.9.1) is installed.

Would someone with suitable access kindly look at the server logs?

One can indeed see that the state at the Ansible Galaxy Web API ( Legacy Roles – Pulp 3 ) is lagging behind the state at the Galaxy back-office UI ( Ansible Galaxy )

These are actually two different roles …

https://galaxy.ansible.com/api/v1/roles/?owner__username=epfl_si&name=ansible_module_openshift

https://galaxy.ansible.com/ui/standalone/roles/epfl_si/ansible-module-openshift/versions/

The role ID’s might help clarify …

jtanner@p1:~$ curl -s 'https://galaxy.ansible.com/api/v1/roles/?owner__username=epfl_si&name=ansible_module_openshift' | jq .results[0].id
33864
jtanner@p1:~$ curl -s 'https://galaxy.ansible.com/api/v1/roles/?owner__username=epfl_si&name=ansible-module-openshift' | jq .results[0].id
38668

Note that one is “ansible_module_openshift” with underscores and the other is “ansible-module-openshift” with hypens. The one with underscores has been around for a while and was migrated over from old-galaxy. The one with hyphens appears to be new and has a recent import log and lists all versions as only a few days old (this happens because we enumerate all tags and retroactively create any missing versions at import time).

Here’s the ansible-module-openshift import log: https://galaxy.ansible.com/ui/standalone/roles/epfl_si/ansible-module-openshift/import_log/

We can identify a few things from the log…

  1. No 'alternate-role-name’ parameter was passed at import time. This would have been defined with the --role-name= argument to “ansible-galaxy role publish”
  2. No *role_name* key was found in meta/main.yml
  3. It defaulted to using the repository name … “ansible-module-openshift

We’ve eliminated all the “magic” with munging role names and namespaces in the new galaxy. So we don’t auto-replace hyphens with underscores, or force anything to all lowercase or any of that unpredictable behavior that used to occur.

If you’d prefer to go back to using “ansible_module_openshift”, then follow these instructions: https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/community/userguide/#changing-the-role-name

I’d suggest deleting whichever role you no longer want via the API (not the ansible-galaxy cli) so that it doesn’t accidentally delete both: https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/community/userguide/#deleting-roles

1 Like