Skip to content

Commit d1ee17a

Browse files
authored
Updated schemas (#2158)
1 parent d51f97d commit d1ee17a

File tree

3 files changed

+112
-66
lines changed

3 files changed

+112
-66
lines changed

src/ansiblelint/schemas/arg_specs.json

Lines changed: 111 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,107 @@
3939
"additionalProperties": false,
4040
"properties": {
4141
"author": {
42-
"type": "string"
42+
"oneOf": [
43+
{
44+
"type": "string"
45+
},
46+
{
47+
"items": {
48+
"type": "string"
49+
},
50+
"type": "array"
51+
}
52+
]
4353
},
4454
"description": {
45-
"type": "string"
55+
"oneOf": [
56+
{
57+
"type": "string"
58+
},
59+
{
60+
"items": {
61+
"type": "string"
62+
},
63+
"type": "array"
64+
}
65+
]
4666
},
4767
"options": {
4868
"additionalProperties": {
4969
"$ref": "#/$defs/option"
5070
},
5171
"type": "object"
5272
},
73+
"seealso": {
74+
"items": {
75+
"oneOf": [
76+
{
77+
"additionalProperties": false,
78+
"properties": {
79+
"description": {
80+
"type": "string"
81+
},
82+
"module": {
83+
"type": "string"
84+
}
85+
},
86+
"required": ["module"],
87+
"type": "object"
88+
},
89+
{
90+
"additionalProperties": false,
91+
"properties": {
92+
"description": {
93+
"type": "string"
94+
},
95+
"plugin": {
96+
"type": "string"
97+
},
98+
"plugin_type": {
99+
"type": "string"
100+
}
101+
},
102+
"required": ["plugin", "plugin_type"],
103+
"type": "object"
104+
},
105+
{
106+
"additionalProperties": false,
107+
"properties": {
108+
"description": {
109+
"type": "string"
110+
},
111+
"ref": {
112+
"type": "string"
113+
}
114+
},
115+
"required": ["description", "ref"],
116+
"type": "object"
117+
},
118+
{
119+
"additionalProperties": false,
120+
"properties": {
121+
"description": {
122+
"type": "string"
123+
},
124+
"link": {
125+
"type": "string"
126+
},
127+
"name": {
128+
"type": "string"
129+
}
130+
},
131+
"required": ["description", "link", "name"],
132+
"type": "object"
133+
}
134+
]
135+
},
136+
"type": "array"
137+
},
53138
"short_description": {
54139
"type": "string"
140+
},
141+
"version_added": {
142+
"type": "string"
55143
}
56144
},
57145
"required": ["options"],
@@ -81,14 +169,24 @@
81169
},
82170
"properties": {
83171
"choices": {
84-
"$ref": "#/$defs/datatype"
172+
"type": "array"
85173
},
86174
"default": {
87175
"default": "None"
88176
},
89177
"description": {
90178
"description": "Detailed explanation of what this option does. It should be written in full sentences.",
91-
"type": "string"
179+
"oneOf": [
180+
{
181+
"type": "string"
182+
},
183+
{
184+
"items": {
185+
"type": "string"
186+
},
187+
"type": "array"
188+
}
189+
]
92190
},
93191
"elements": {
94192
"$ref": "#/$defs/datatype"
@@ -105,13 +203,22 @@
105203
"description": "The name of the option/argument.",
106204
"type": "string"
107205
},
206+
"options": {
207+
"additionalProperties": {
208+
"$ref": "#/$defs/option"
209+
},
210+
"type": "object"
211+
},
108212
"required": {
109213
"default": false,
110214
"type": "boolean"
111215
},
112216
"type": {
113217
"$ref": "#/$defs/datatype",
114218
"markdownDescription": "See [argument-spec](https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec"
219+
},
220+
"version_added": {
221+
"type": "string"
115222
}
116223
},
117224
"removed_at_date": {

test/eco/docker-rootless.result

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@ CMD: ansible-lint -f pep8 -x fqcn-builtins
33
RC: 0
44

55
STDERR:
6-
WARNING Listing 8 violation(s) that are fatal
7-
You can skip specific rules or tags by adding them to your configuration file:
8-
# .config/ansible-lint.yml
9-
warn_list: # or 'skip_list' to silence them completely
10-
- experimental # all rules tagged as experimental
11-
126

137

148
STDOUT:
15-
meta/main.yml:1: schema: 8 is not one of ['6.1', '7.1', '7.2', 'all'] (schema[meta])
16-
molecule/default/verify.yml:1: schema: 'yes' is not of type 'boolean' (schema[playbook])
17-
tasks/bashrc.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
18-
tasks/docker_install_rootful.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
19-
tasks/docker_install_rootless.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
20-
tasks/docker_service_rootful.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
21-
tasks/manage_user.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
22-
tasks/pre.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])

test/eco/hardening.result

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,17 @@ CMD: ansible-lint -f pep8 -x fqcn-builtins
33
RC: 2
44

55
STDERR:
6-
WARNING Listing 50 violation(s) that are fatal
6+
WARNING Listing 5 violation(s) that are fatal
77
You can skip specific rules or tags by adding them to your configuration file:
88
# .config/ansible-lint.yml
99
warn_list: # or 'skip_list' to silence them completely
10-
- experimental # all rules tagged as experimental
1110
- load-failure # Failed to load or parse file.
12-
- schema # Perform JSON Schema Validation for known lintable kinds.
1311

1412

1513

1614
STDOUT:
1715
defaults/main/sshd.yml:20: yaml: line too long (143 > 120 characters) (yaml[line-length])
18-
meta/main.yml:1: schema: 8 is not one of ['6.1', '7.1', '7.2', 'all'] (schema[meta])
19-
molecule/default/verify.yml:1: schema: 'yes' is not of type 'boolean' (schema[playbook])
20-
tasks/adduser.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
21-
tasks/aide.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
22-
tasks/apparmor.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
23-
tasks/apport.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
24-
tasks/auditd.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
2516
tasks/auditd.yml:21: yaml: line too long (122 > 120 characters) (yaml[line-length])
26-
tasks/compilers.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
27-
tasks/cron.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
28-
tasks/ctrlaltdel.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
29-
tasks/disablefs.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
30-
tasks/disablemod.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
31-
tasks/disablenet.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
32-
tasks/disablewireless.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
33-
tasks/extras.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
34-
tasks/firewall.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
35-
tasks/fstab.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
36-
tasks/hosts.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
37-
tasks/issue.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
38-
tasks/journalconf.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
39-
tasks/limits.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
40-
tasks/lockroot.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
41-
tasks/logindconf.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
42-
tasks/logindefs.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
43-
tasks/motdnews.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
44-
tasks/mount.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
45-
tasks/packagemgmt.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
4617
tasks/packagemgmt.yml:164: yaml: line too long (129 > 120 characters) (yaml[line-length])
4718
tasks/packagemgmt.yml:192: yaml: line too long (162 > 120 characters) (yaml[line-length])
48-
tasks/packages.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
49-
tasks/password.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
50-
tasks/path.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
51-
tasks/post.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
52-
tasks/postfix.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
53-
tasks/pre.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
54-
tasks/prelink.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
55-
tasks/resolvedconf.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
56-
tasks/rkhunter.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
57-
tasks/rootaccess.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
58-
tasks/sshconfig.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
59-
tasks/sudo.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
60-
tasks/suid.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
61-
tasks/sysctl.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
62-
tasks/systemdconf.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
63-
tasks/timesyncd.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
64-
tasks/umask.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
65-
tasks/users.yml:1: schema: 'yes' is not of type 'boolean' (schema[tasks])
6619
templates/usr/share/dict/passwords.list.j2:1: load-failure: 'utf-8' codec can't decode byte 0xc3 in position 104779: invalid continuation byte (load-failure[unicodedecodeerror])

0 commit comments

Comments
 (0)