Hello,
I would ask an help for an error I can’t understand. I wrote my own collection. I checked it with ansible-lint
and it didn’t return errors or warnings.
In the collection’s roles I write some CI tests in the form:
/<collection_name>/roles/<role_name>/test/test.yml
---
- name: Test role <rone_name>
hosts: localhost
roles:
- <namespace>.<collection_name>.<role_name>
I use the FQCN notation in place of the deprecated collections:
keyword, because ansible-lint
tell me to work in this way.
This is working well in my CI environment, ansible-playbook
works fine. As I said above, ansible-lint
command passes all tests.
But when I try to publish the collection into my own Galaxy-NG server I see warnings like this:
[WARNING]: Galaxy import warning message: roles/<role_name>/tests/test.yml:44:7: syntax-check[specific]: the role '<namespace>.<collection_name>.<role_name>' was not found in
/tmp/tmppa432ngx/ansible_collections/<namespace>/<collection_name>/roles/<role_name>/tests/roles:/var/lib/pulp/.cache/ansible-compat/92a5dc/roles:/tmp/tmppa432ngx/ansible_collections/<namespace>/<collection_name>/roles:/var/lib/pulp/.ansible/roles:/usr/share
/ansible/roles:/etc/ansible/roles:/tmp/tmppa432ngx/ansible_collections/<namespace>/<collection_name>/roles/<role_name>/tests
I don’t understand why this happens. I believed that if ansible-lint
succeeded, then the similar check in Galaxy would not have complained.
My question is: How do I can avoid these warnings?
These warnings only happen when I try to publish the collection in Galaxy-NG.
Ps: another warning that I see only during Galaxy import is
[ERROR]: Galaxy import error message: CHANGELOG.rst file not found at top level of collection.
I fix this error just creating the required files.
ansible-lint
instead is satisfied with the file changelogs/changelog.yaml
as described in official documentation.
My software versions are:
- ansible-lint 24.2.0 using ansible-core:2.16.2 ansible-compat:4.1.11 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.8
- Galaxy-NG 4.6.3
- Pulp Ansible 0.15.2
Thank you very much for every feedback and hints
Kind Regards
Marco