Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message for platform 'Amazon Linux 2023' #3411

Closed
coglinev3 opened this issue May 8, 2023 · 0 comments · Fixed by #3405
Closed

Incorrect error message for platform 'Amazon Linux 2023' #3411

coglinev3 opened this issue May 8, 2023 · 0 comments · Fixed by #3405
Labels

Comments

@coglinev3
Copy link

Summary

Ansible-lint version 6.15.0 generates an error message if Amazon Linux 2023 is specified as supported platform in meta/main.yml.

Issue Type
  • Bug Report
Ansible and Ansible Lint details

ansible-lint 6.15.0, installed via pip

ansible-lint --version

ansible-lint 6.15.0 using ansible 2.14.5
STEPS TO REPRODUCE

Create a meta/main.yml file like following in a role:

galaxy_info:
  author: author-name
  role_name: testrole
  namespace: author-namespace
  description: test
  license: BSD 
  min_ansible_version: "2.14"
  platforms:
    - name: Amazon Linux 2023
    - name: Alpine
    - name: Debian
      versions:
        - buster
        - bullseye
  galaxy_tags:
    - test
dependencies: []
Desired Behavior

No warning or error message for platform "Amazon Linux 2023" from ansible-lint, because it's a supported platform (see Ansible Galaxy API https://galaxy.ansible.com/api/v1/platforms/?search=Amazon+Linux+2023).

GET /api/v1/platforms/?search=Amazon+Linux+2023

HTTP 200 OK
  Allow: GET, HEAD, OPTIONS
  Content-Type: application/json
  Vary: Accept
  {
    "count": 1,
    "next": null,
    "next_link": null,
    "previous": null,
    "previous_link": null,
    "results": [
        {
            "id": 286,
            "url": "[/api/v1/platforms/286/](https://galaxy.ansible.com/api/v1/platforms/286/)",
            "related": {},
            "summary_fields": {},
            "created": "2023-04-20T16:33:15.181716Z",
            "modified": "2023-04-20T16:33:15.181737Z",
            "name": "Amazon Linux 2023",
            "release": "any",
            "active": true
        }
    ]
}
Actual Behavior
schema[meta]: {'name': 'Amazon Linux 2023'} is not valid under any of the given schemas
meta/main.yml:1  Returned errors will not include exact line numbers, but they will mention
the schema name being used as a tag, like ``schema[playbook]``,
``schema[tasks]``.

This rule is not skippable and stops further processing of the file.

If incorrect schema was picked, you might want to either:

* move the file to standard location, so its file is detected correctly.
* use ``kinds:`` option in linter config to help it pick correct file type.

Read documentation for instructions on how to ignore specific rule violations.

            Rule Violation Summary              
 count tag            profile   rule   associated tags 
     1 schema[meta]   basic     core
@coglinev3 coglinev3 added bug new Triage required labels May 8, 2023
@audgirka audgirka removed the new Triage required label May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants