# Sync problems on the Ansible Galaxy API

**URL:** <https://forum.ansible.com/t/sync-problems-on-the-ansible-galaxy-api/6772>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [June 25, 2024, 4:40pm UTC](https://forum.ansible.com/t/sync-problems-on-the-ansible-galaxy-api/6772 "2024-06-25T16:40:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![domq](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/domq/32/974_2.png) [@domq](https://forum.ansible.com/u/domq)\
**Post date:** [June 25, 2024, 4:40pm UTC](https://forum.ansible.com/t/sync-problems-on-the-ansible-galaxy-api/6772/1 "2024-06-25T16:40:58Z")

</div>

Hello, it seems like the [galaxy.ansible.com](http://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

```yaml
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?

---

<div class="post-metadata">

**Author:** ![domq](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/domq/32/974_2.png) [@domq](https://forum.ansible.com/u/domq)\
**Post date:** [June 25, 2024, 4:41pm UTC](https://forum.ansible.com/t/sync-problems-on-the-ansible-galaxy-api/6772/2 "2024-06-25T16:41:35Z")

</div>

One can indeed see that the state at the Ansible Galaxy Web API ( [Legacy Roles – Pulp 3](https://galaxy.ansible.com/api/v1/roles/?owner__username=epfl_si&name=ansible_module_openshift) ) is lagging behind the state at the Galaxy back-office UI ( [Ansible Galaxy](https://galaxy.ansible.com/ui/standalone/roles/epfl_si/ansible-module-openshift/versions/) )

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [June 27, 2024, 2:49am UTC](https://forum.ansible.com/t/sync-problems-on-the-ansible-galaxy-api/6772/3 "2024-06-27T02:49:45Z")

</div>

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/api/v1/roles/?owner__username=epfl_si&name=ansible_module_openshift)

[https://galaxy.ansible.com/ui/standalone/roles/epfl\_si/ansible-module-openshift/versions/](https://galaxy.ansible.com/ui/standalone/roles/epfl_si/ansible-module-openshift/versions/)

The role ID’s might help clarify …

```auto
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/](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](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](https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/community/userguide/#deleting-roles)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 27, 2024, 2:50am UTC](https://forum.ansible.com/t/sync-problems-on-the-ansible-galaxy-api/6772/4 "2024-07-27T02:50:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
