Skip to content

Commit

Permalink
Add attributes for role argument specs (#4018)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
felixfontein and pre-commit-ci[bot] authored Feb 12, 2024
1 parent 5872135 commit 4b91197
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
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

0 comments on commit 4b91197

Please sign in to comment.