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
All schema checks disallow additional properties, this is really problematic when trying to keep roles DRY. i.e. we have some roles with multiple entrypoints (deployment of a specific type of app in docker or on host): 90% of the variables are the same, a few are different. What we tend to do, is declare common options above, and reference them later using anchors:
---
common_options: &common_optionsapplication_name:
description: | Name of the application being deployed, should be a unique, valid username, service name and directory name.required: trueapplication_version:
description: The version of the application to deployrequired: trueserver_port:
description: | The port on which to expose the application. If a falsy value is passed, `web-application-type` will be set to `none`, disabling the web server.type: intdefault: 8080# ........argument_specs:
host:
short_description: Entry point used to deploy a springboot application as a systemd serviceoptions:
<<: *common_options# specific optionsdocker:
short_description: Entry point used to deploy a springboot application packaged as a containeroptions:
<<: *common_options# specific options
This fails with
WARNING Listing 1 violation(s) that are fatal
roles/springboot_app/meta/argument_specs.yml:1: schema[arg_specs]: Additional properties are not allowed ('common_options' was unexpected)
Read documentation for instructions on how to ignore specific rule violations.
Rule Violation Summary
count tag profile rule associated tags
1 schema[arg_specs] basic core
I could ignore schema[arg_specs] entirely, but that would hide a lot of useful information. Does anyone see a better way? If not, is there a way to explicitly tell ansible-lint that we do in fact use additional properties and that it's fine?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
All schema checks disallow additional properties, this is really problematic when trying to keep roles DRY. i.e. we have some roles with multiple entrypoints (deployment of a specific type of app in docker or on host): 90% of the variables are the same, a few are different. What we tend to do, is declare common options above, and reference them later using anchors:
This fails with
I could ignore
schema[arg_specs]
entirely, but that would hide a lot of useful information. Does anyone see a better way? If not, is there a way to explicitly tell ansible-lint that we do in fact use additional properties and that it's fine?Beta Was this translation helpful? Give feedback.
All reactions