Skip to content

Conversation

viccie30
Copy link

@viccie30 viccie30 commented Oct 2, 2025

This matches what ansible.builtin.yaml accepts as input.
Working on this I have a few questions:

  1. The all group had a groups property, but that doesn't seem to be accepted by Ansible, so I removed it. Is that correct?
  2. vars and children also accept a string, like hosts, and turn this into a dictionary with the string as a key and null as the value. It does not seem really useful, but because the syntax is accepted I added it to the schema.
  3. Host and group variables starting with a digit are accepted, but are deprecated. I've written the schema to reject them, is this the wanted behavior?

@viccie30 viccie30 requested a review from a team as a code owner October 2, 2025 15:07
@viccie30 viccie30 force-pushed the fix-inventory-schema branch from 3914554 to fc11f6b Compare October 2, 2025 15:08
@viccie30 viccie30 changed the title Make inventory JSON Schema match actually accepted inventories fix(schema): Make inventory JSON Schema match actually accepted inventories Oct 2, 2025
@viccie30 viccie30 force-pushed the fix-inventory-schema branch from fc11f6b to 2e26f9e Compare October 2, 2025 15:09
@github-actions github-actions bot added the fix label Oct 2, 2025
@viccie30
Copy link
Author

viccie30 commented Oct 2, 2025

I have no clue why the schemas test fails. I get the same error locally, but I have no idea what's wrong with my changes to make it fail like that.

@viccie30
Copy link
Author

viccie30 commented Oct 2, 2025

I have no clue why the schemas test fails. I get the same error locally, but I have no idea what's wrong with my changes to make it fail like that.

Found it: the examples property was abused to list filenames. I've changed it to x-ansible-lint.

The duplication of the error is because all is validated against both patternProperties and its specific entry under properties. The explicit duplication under properties is only to update the description for all and unbound, so it can be removed without further problems if preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant