-
Notifications
You must be signed in to change notification settings - Fork 234
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
ansible - include_tasks: Incorrect type. Expected "object". #105
Comments
According to the schema it should be an object whereas the provided snippet it is a scalar. I'm not familiar with ansible so I don't know which is correct but if the snippet is correct there is an error in the schema. |
The snippet is correct. See documentation: https://docs.ansible.com/ansible/latest/modules/import_tasks_module.html |
By searching the schema for "free-form" I found more modules that lead to this syntax false-error:
Is this a problem of the schema or of the interpretation of free-form? |
It looks like its a problem in the schema and also an error in the ansible documentation itself. From what i'm understanding free_form isn't actually a parameter you can specify so the actual type in the schema for include_tasks and import_tasks should be a string. I've filed an issue here and once that fix is applied to the schema on the schema store it should pick up the changes after VSCode is reloaded! |
@JPinkney This is now fixed upstream and new schemas are in SchemaStore. |
@shaded-enmity Thanks! |
I found another case which triggers an invalidation:
One workaround is to add a "name:" to these blocks to avoid the very confusing error This reminds me of the fact that we probaly need a better way to report a schema error, to send people to the right issue tracker for each schema. Maybe even to advertise this on each popup? Another issue found was that it complains when it finds an empty
The code above is valid YAML as it gives a null dictionary to setup, still, the schema validation fails, forcing user to put something there. |
@ssbarnea Yup, the problem is that LSP (Language server protocol) doesn't really support that in a reasonable manner, I've opened microsoft/language-server-protocol#519 some weeks back. I think the problem with Thanks |
@shaded-enmity Check http://codesearch.openstack.org/?q=block%3A&i=nope&files=.yml&repos= for planty of examples of block usage inside playbooks, is very common. |
Another problem found:
The error is that expects string for "cacheable", when we know that bool is clearly acceptable (and likely). |
FYI: if you're not using a "name" field in any task, the error |
Visual Studio code incorrectly flags syntax errors with
include_tasks
andimport_tasks
related to #96
The Schema source extract:
from https://github.com/SchemaStore/schemastore/pull/490/files
The text was updated successfully, but these errors were encountered: