You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the environment: option, the environment variable values passed are required to be in full quotes (string types) when environment variables can be other types, too. Failure to put the values in quotes results in "is not valid under any of the given schemas" error message.
I would expect the scheme to recognize that the environment variable value is an integer, which is correct, rather than a string.
Actual Behavior
What actually happens is that this breaks the pipeline due to the linting error.
~$ ansible-lint package_cache.yaml
WARNING Listing 1 violation(s) that are fatal
schema[tasks]: {'name': 'Suse - Building zypper cache', 'community.general.zypper_repository': {'repo': '*', 'runrefresh': True, 'auto_import_keys': True, 'disable_gpg_check': True}, 'environment': {'ZYPP_PLUGIN_TIMEOUT': 120, 'ZYPP_PLUGIN_SEND_TIMEOUT': '120', 'ZYPP_PLUGIN_RECEIVE_TIMEOUT': '120'}} is not valid under any of the given schemas
package_cache.yaml:1 Returned errors will not include exact line numbers, but they will mention
the schema name being used as a tag, like ``schema[playbook]``,
``schema[tasks]``.
This rule is not skippable and stops further processing of the file.
If incorrect schema was picked, you might want to either:
* move the file to standard location, so its file is detected correctly.
* use ``kinds:`` option in linter config to help it pick correct file type.
Read documentation for instructions on how to ignore specific rule violations.
Rule Violation Summary
count tag profile rule associated tags
1 schema[tasks] basic core
Failed: 1 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'min'.
~$
Therefore, to pass the linting requirement the values must be quoted, thus turning them into strings. So this:
Summary
When using the
environment:
option, the environment variable values passed are required to be in full quotes (string types) when environment variables can be other types, too. Failure to put the values in quotes results in "is not valid under any of the given schemas" error message.Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
Simply use the
environment:
option and pass some variables, such as:Desired Behavior
I would expect the scheme to recognize that the environment variable value is an integer, which is correct, rather than a string.
Actual Behavior
What actually happens is that this breaks the pipeline due to the linting error.
Therefore, to pass the linting requirement the values must be quoted, thus turning them into strings. So this:
Needs to be:
Which results in:
Others have reported similar issues.
The text was updated successfully, but these errors were encountered: