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

Add attributes for role argument specs #4018

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/ansiblelint/schemas/role-arg-spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
{
"$defs": {
"attribute": {
"additionalProperties": false,
"properties": {
"description": {
"description": "Detailed explanation of what this attribute does. It should be written in full sentences.",
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"details": {
"description": "Detailed explanation of what this attribute does. It should be written in full sentences.",
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"membership": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"platform": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"support": {
"enum": ["full", "partial", "none", "N/A"],
"type": "string"
},
"version_added": {
"type": "string"
}
},
"required": ["description", "support"],
"title": "Attribute"
},
"datatype": {
"enum": [
"str",
Expand Down Expand Up @@ -38,6 +106,12 @@
"entry_point": {
"additionalProperties": false,
"properties": {
"attributes": {
"additionalProperties": {
"$ref": "#/$defs/attribute"
},
"type": "object"
},
"author": {
"oneOf": [
{
Expand Down
16 changes: 16 additions & 0 deletions test/schemas/test/roles/foo/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ argument_specs:
author:
- Foobar Baz
- Bert Foo
attributes:
idempotent:
description: Whether the role is idempotent.
support: full
check_mode:
description:
- Whether the role supports check mode.
support: partial
details:
- Does not work if O(my_app_int=5).
version_added: 1.2.0
action_group:
description:
- Use C(group/foo.bar.baz) in C(module_defaults) to set authentication options for the C(foo.bar) modules used by this role.
support: full
membership: foo.bar.baz
options:
my_app_int:
type: "int"
Expand Down
Loading