# Role meta data platform key broken?

**URL:** <https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651>\
**Category:** Get Help\
**Tags:** galaxy, role, ubuntu, collections, ansible-lint, galaxy-ng\
**Created:** [March 31, 2024, 10:20pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651 "2024-03-31T22:20:30Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![thorian93](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thorian93/32/1320_2.png) [@thorian93](https://forum.ansible.com/u/thorian93)\
**Post date:** [March 31, 2024, 10:20pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/1 "2024-03-31T22:20:30Z")

</div>

I might have missed the memo, but is the `galaxy_info.platforms:` key gone or deprecated with the new Galaxy?

`ansible-lint` gives me: `schema[meta]: $.galaxy_info.platforms[1].versions[0] 'Stretch' is not one of ['6.1', '7.1', '7.2', 'all']. See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-role-dependencies` which is both confusing and the link seems unrelated.

This is an excerpt of my `meta/main.yml`:

```auto
  platforms:
    - name: Debian
      versions:
        - Stretch
        - Buster
        - Bullseye
    - name: Ubuntu
      versions:
        - Xenial
        - Bionic
        - Focal
        - Jammy

```

The role is part of a collection, but `ansible-lint` runs against the `roles` directory.

Also with the old API at [https://galaxy.ansible.com/api/v1/platforms/](https://galaxy.ansible.com/api/v1/platforms/) gone, I also cannot look up, what is expected of me.

P.S.: This is a link to my Github actions, if one wants to take a peek: [Linting · Workflow runs · thorian93/main · GitHub](https://github.com/thorian93/main/actions/workflows/linting.yaml)

_P.P.S.: To whom it may concern: The template for a new message has a typo:_  
_- Include rel **a** vant logs from the issue_

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [March 31, 2024, 11:23pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/2 "2024-03-31T23:23:19Z")

</div>

Use lower case for the `versions`:

```yaml
  platforms:
    - name: Debian
      versions:
        - bookworm
        - bullseye
        - buster

```

---

<div class="post-metadata">

**Author:** ![thorian93](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thorian93/32/1320_2.png) [@thorian93](https://forum.ansible.com/u/thorian93)\
**Post date:** [April 1, 2024, 12:34am UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/3 "2024-04-01T00:34:07Z")

</div>

Thanks! I will test that.

Follow-up question: I get the same error for `EL`, where versions are used. No matter, if it is `6`, `7` or `8`, I get the same error as above. Even if I change it to e.g., `7.1`, the message remains.

I feel like this is more like a red herring.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [April 1, 2024, 12:36am UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/4 "2024-04-01T00:36:09Z")

</div>

I only test on Debian and Ubuntu so I don’t know, but you could try quoting the version numbers to ensure they are strings and not integers to see if that helps?

---

<div class="post-metadata">

**Author:** ![thorian93](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thorian93/32/1320_2.png) [@thorian93](https://forum.ansible.com/u/thorian93)\
**Post date:** [April 1, 2024, 3:26pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/5 "2024-04-01T15:26:39Z")

</div>

Based on the error message:  
`schema[meta]: $.galaxy_info.platforms[1].versions[0] 'Stretch' is not one of ['6.1', '7.1', '7.2', 'all']. [...]`  
I am very certain, that the way I note the `platforms` is not the issue. It gives me only four options: `['6.1', '7.1', '7.2', 'all']`  
And even using one of those does not seem to do the trick.

Maybe someone else has an idea? I will test this sometime though, perhaps I can find a workaround. But either my mistake is borderline stupid, or something is broken. I don’t care which it is, as long as I can figure it out. 🙂

---

<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:** [April 1, 2024, 3:43pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/6 "2024-04-01T15:43:48Z")

</div>

If the error message involves `Stretch`, you didn’t use the correct form, which is lowercase. That would be `stretch`.

The limit to `['6.1', '7.1', '7.2', 'all']` is likely an artefact of the schema validation: since it cannot match the whole dict you provided to any of the schemes it knows, it takes the list of values from the first schema, which happens to be for `name=AIX` and has exactly these four values.

Simply fix the casing as @chris pointed out.

---

<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:** [April 1, 2024, 3:45pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/7 "2024-04-01T15:45:16Z")

</div>

> [@thorian93](#):
>
> _P.P.S.: To whom it may concern: The template for a new message has a typo:_  
> _- Include rel **a** vant logs from the issue_

@gwmngilfen ^ (adding some more text to reach 20 characters)

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [April 1, 2024, 4:06pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/8 "2024-04-01T16:06:22Z")

</div>

This seems like a bug to me.

The actual schema for this used by Ansible-Lint is found here:  
[ansible-lint/src/ansiblelint/schemas/meta.json at main · ansible/ansible-lint (github.com)](https://github.com/ansible/ansible-lint/blob/main/src/ansiblelint/schemas/meta.json#L151)

It _should_ report that the given list for the Debian platform does not match: `["bookworm","bullseye","buster","etch","jessie","lenny","sid","squeeze","stretch","trixie", "wheezy","all"]`, but instead is returning the supported versions for the AIX platform (the very first platform in the list).

@ssbarnea is this a known or previously fixed issue? I see a couple of recently closed related issues, but I didn’t see any PR’s. Just mention that you have to quote integers. In this case, we’re not using integers, we’re using strings with incorrect casing, but the error message is entirely unhelpful because it doesn’t match the platform in question.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [April 1, 2024, 4:51pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/9 "2024-04-01T16:51:35Z")

</div>

platforms is ignored in the current version of galaxy, we are in the middle of removing it from the generator template in core.

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [April 1, 2024, 8:43pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/10 "2024-04-01T20:43:01Z")

</div>

> [@felixfontein](#):
>
> > [@thorian93](#):
> >
> > _P.P.S.: To whom it may concern: The template for a new message has a typo:_  
> > _- Include rel **a** vant logs from the issue_
> 
> @gwmngilfen ^ (adding some more text to reach 20 characters)

Fixed. thanks to you both for pointing this out (and to discourse for ensuring I have to type 20 chars to reply)

---

<div class="post-metadata">

**Author:** ![thorian93](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thorian93/32/1320_2.png) [@thorian93](https://forum.ansible.com/u/thorian93)\
**Post date:** [April 1, 2024, 10:44pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/11 "2024-04-01T22:44:56Z")

</div>

> [@bcoca](#):
>
> platforms is ignored in the current version of galaxy, we are in the middle of removing it from the generator template in core.

So I am good to remove it entirely from my roles, as the Galaxy will not support now or in the forseeable future?

Thanks @samccann for the quick fix!

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [April 2, 2024, 2:17pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/12 "2024-04-02T14:17:56Z")

</div>

yep ‘now i need to fill 20 chars’

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [April 2, 2024, 5:34pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/13 "2024-04-02T17:34:44Z")

</div>

hehe here’s something to fill your 20 chars - Is the meta/main.yml settings fully defined somewhere so we can link to them from the docs? There’s been more than one question in this area lately. See [Improve meta/main.yml documentation for roles · Issue #1241 · ansible/ansible-documentation · GitHub](https://github.com/ansible/ansible-documentation/issues/1241)…

---

<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:** [May 2, 2024, 5:35pm UTC](https://forum.ansible.com/t/role-meta-data-platform-key-broken/4651/14 "2024-05-02T17:35:25Z")

</div>

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