# Ansible-galaxy lint unexpected warnings

**URL:** <https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825>\
**Category:** Get Help\
**Tags:** collections, ansible-lint, galaxy-ng\
**Created:** [February 12, 2024, 1:48pm UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825 "2024-02-12T13:48:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![falon](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/falon/32/2081_2.png) [@falon](https://forum.ansible.com/u/falon)\
**Post date:** [February 12, 2024, 1:48pm UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825/1 "2024-02-12T13:48:42Z")

</div>

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

```auto
---
- 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:

```auto
[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

```auto
[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

---

<div class="post-metadata">

**Author:** ![falon](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/falon/32/2081_2.png) [@falon](https://forum.ansible.com/u/falon)\
**Post date:** [February 15, 2024, 3:40pm UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825/2 "2024-02-15T15:40:38Z")

</div>

Hello,  
I have updated my Galaxy-NG to the version 4.9.1 and the above warnings disappear.

Now I see new warnings during `ansible-galaxy collection publish` process which I can’t resolve:

```auto
[WARNING]: Galaxy import warning message: roles/<role name>/tasks/main.yml:9:3: syntax-check[specific]: couldn't resolve module/action 'community.general.ini_file'.
This often indicates a misspelling, missing collection, or incorrect module path.

```

In the develop environment `ansible-lint` doesn’t show this warning. My suspect was that on Galaxy-NG the `community.general` is not synced. So I synced the remote collection.  
I have also added `community.general` as dependency in the _galaxy.yml_ file of my own collection.

Then, I have deleted and published again my collection. The warning still shows.

My collection also use an external standalone role. Again, I don’t see problems by running a local `ansible-lint`, but when I publish the collection I see

```auto
[WARNING]: Galaxy import warning message: playbooks/myOS.yml:300:7: syntax-check[specific]: the role 'arillso.logrotate' was not found [...]

```

Tha playbook myOS.yml contains

```auto
  roles:
    - arillso.logrotate

```

I wonder how to avoid the above warnings. About _missing collection_, [syncing them from remote](https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/usage_guide/collections/#syncing-collections) is not sufficient.

Thank you for every hints  
Kind Regards

Marco

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [February 16, 2024, 6:44am UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825/3 "2024-02-16T06:44:29Z")

</div>

The Galaxy importer does not installs _any_ other collections except the one to import in its environment, and then runs various tools on it. This is also a problem for documentation extraction, see [Galaxy importer: collection dependency handling](http://forum.ansible.com/t/galaxy-importer-collection-dependency-handling/3496).

---

<div class="post-metadata">

**Author:** ![ssbarnea](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ssbarnea/32/4923_2.png) [@ssbarnea](https://forum.ansible.com/u/ssbarnea)\
**Post date:** [February 16, 2024, 9:39am UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825/4 "2024-02-16T09:39:14Z")

</div>

Please cross post this to linter issue tracker. The fact that it does not detect missing chagelog is a bug. We aim to make linter enough to succeed publishing to galaxy.

The warning might be because of an older version of linter in galaxy uploader but needs to be checked.

Anyway, i will look into addressing these once we have bug filed. If needed we might have to raise a bug on galaxy importer but that is not sure yet.

---

<div class="post-metadata">

**Author:** ![falon](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/falon/32/2081_2.png) [@falon](https://forum.ansible.com/u/falon)\
**Post date:** [February 16, 2024, 10:38am UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825/5 "2024-02-16T10:38:53Z")

</div>

Thank you for paying attention to this.  
I [filled a bug](https://github.com/ansible/ansible-lint/issues/4032) in ansible-lint now.  
Please, ignore the `CHANGELOG.rst file not found` bug. I already verified that it happens only in Galaxy-NG 4.6.3, it has been fixed in 4.9.1.

---

<div class="post-metadata">

**Author:** ![allhart](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/allhart/32/9400_2.png) [@allhart](https://forum.ansible.com/u/allhart)\
**Post date:** [February 16, 2024, 8:39pm UTC](https://forum.ansible.com/t/ansible-galaxy-lint-unexpected-warnings/3825/6 "2024-02-16T20:39:36Z")

</div>

We’re currently testing a newer version of ansible-lint to upgrade to in galaxy-importer dependencies, planning to move to 6.22.x.
