-
Notifications
You must be signed in to change notification settings - Fork 677
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
False positive: hosts variable not defined #4225
Comments
Similarly, this issue does not go away even if the undefined part has a default and is a limiting filter: hosts: "SOME_LOADBALANCERS:&{{ zone | default('SOME_ZONE') }}" Side note: Yes I know you can do this with |
Is there any ETA on when this might be added? Thanks! |
Has this been addressed? My VSCode is still showing these as errors - if it has been added, how do I configure it properly? Thanks! |
Unfortunately, no. I may consider looking back into this issue sometime in the future. |
Summary
False positive for undefined variable in hosts.
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
See issue #3229 - same question.
Desired Behavior
Answer was provided - #3229 (comment) - but the answer is to set a default value for
hosts
, which I would never want to do.Desired behavior is that we can set something in ansible-lint config to tell ansible-lint to ignore any undefined variables - either altogether, or specifically in the
hosts:
lineActual Behavior
ansible-lint highlights error -
The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'hosts_used' is undefined
This isn't an error - all my playbooks are designed to feed in a host as needed, on purpose. So, I should be able to tell Lint to ignore this error. Desired behavior is that we can set something in ansible-lint config to tell ansible-lint to ignore any undefined variables - either altogether, or specifically in the
hosts:
lineThe text was updated successfully, but these errors were encountered: