There’s an overlap between the two, all of the noobient roles are also found under bviktor.
BUT the 6 roles that are ALSO under noobient have a broken repo URL in the bviktor namespace, breaking all my playbooks. E.g. the “logrotate” role. I’d give you links, but apparently “new users are only allowed to post 2 links”, because reasons.
On top of that, the bviktor namespace appears to be owned by me (I see some “Ansible Lightspeed Settings”, but nothing about adding or fetching roles), but the noobient one isn’t even so. It’s stuck in limbo, owned by no one.
So I have no idea what happened but I’d really like to fix these, because I’m unable to use OR manage my roles as of now.
TLDR: can you please grant me ownership to the noobient namespace, and also any resources how I’m supposed to add new roles to them and update existing ones, especially remote URLs that have been broken since the update to NG?
noobient is now bound to bvikor so you should have full control over it.
The roles in noobient are a side effect of bad sync code that we have since corrected. If you’d like to delete them, please use the instructions provided here
So I falled back to https://galaxy.ansible.com/api/. it might also be worth adding a note that one should most likely put their token in ~/.ansible.cfg, not in under /etc, or even worse, in the repo root.
Then I tried an import, and it fails:
$ ansible-galaxy role import noobient ansible-galaxy-logrotate
Successfully submitted import request 2054447221603017279459396803068401469
running
No role readme found
File "/venv/lib64/python3.11/site-packages/pulpcore/tasking/tasks.py", line 66, in _execute_task
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/galaxy_ng/app/api/v1/tasks.py", line 370, in legacy_role_import
result = import_legacy_role(checkout_path, namespace.name, importer_config, logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/galaxy_importer/legacy_role.py", line 51, in import_legacy_role
return _import_legacy_role(dirname, namespace, cfg, logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/galaxy_importer/legacy_role.py", line 57, in _import_legacy_role
data = LegacyRoleLoader(dirname, namespace, cfg, logger).load()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/legacy_role.py", line 43, in load
self.readme = self._load_readme()
^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/legacy_role.py", line 99, in _load_readme
raise exc.ImporterError("No role readme found")
I think I’m on the latest of everything, just ran the update before doing all this:
And that’s about it. As I’m publishing roles, not collections, I don’t even have a “roles” folder. Not to mention that according to the bug report, not even the collection workaround works anymore.
So that’s where I’m stuck as of now. In any case, I do have a readme.md in all my role roots…
File "/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/legacy_role.py", line 99, in _load_readme
raise exc.ImporterError("No role readme found")
This comes from this section of galaxy-importer …
So the importer code is looking for README.md and only README.md. The role’s repository contains readme.md. To fix the error, rename readme.md to README.md.
ansible-galaxy role import simply ignores the --role-name argument
The ansible-role- prefix is not automatically trimmed either, even though the doc claims so.
Because of that, I have some badly names roles now. But trying to delete roles using ansible-galaxy role delete gives an ERROR! None (HTTP Code: 500, Message: Internal Server Error)
Does anyone ever test these? Sorry if I’m rude, and I know you’re trying to help, but there’s pretty much no step in this process that’s not broken one way or another. Excruciating.
ansible-galaxy role import simply ignores the --role-name argument
It wasn’t completely ignored, but there is a logic bug in the import code which assumed galaxy-importer was going to return a null name if not defined in meta/main.yml and then would have used the supplied alternate-role-name.
I see in the logs for your first import that it set the final name to ansible-galaxy-namespace …
"==== PARAMETERS ===="
"importer username: bviktor"
"matched user: bviktor id:1078"
"github_user: bviktor"
"github_repo: ansible-galaxy-namespace"
"github_reference: None"
"alternate_role_name: acme"
"===== PROCESSING LOADER RESULTS ===="
"enumerated role name ansible-galaxy-namespace"
"created new role id:37292 bviktor.ansible-galaxy-namespace"
The reason it ended up with that is because galaxy-importer used the checkout path to make up the name …
I think what we need to do is change the line in the import code to use the metadata.galaxy_info.role_name property as the first choice instead of .name.
I’ve opened a bug to capture this and will try to get it fixed soon.