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
$ ansible-lint --versionansible-lint 6.10.2 using ansible 2.14.3A new release of ansible-lint is available: 6.10.2 → 6.14.3 Upgrade by running: pip install --upgrade ansible-lint
WARNING Listing 1 violation(s) that are fatal
syntax-check[specific]: The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'hostvars' is undefined. 'hostvars' is undefined
playbooks/test2.yml:26:3
You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list: # or 'skip_list' to silence them completely
- syntax-check[specific] # Ansible syntax check failed.
Rule Violation Summary
count tag profile rule associated tags
1 syntax-check[specific] min core
Failed after : 1 failure(s), 0 warning(s) on 1 files.
A new release of ansible-lint is available: 6.10.2 → 6.14.3 Upgrade by running: pip install --upgrade ansible-lint
Note, also
ansible-playbook --syntax-check test.yml
gives
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
ERROR! The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'hostvars' is undefined. 'hostvars' is undefined
The error appears to be in '<path to test>/test.yml': line 26, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Test2
^ here
Desired Behavior
No Errors from above playbook
Possible security bugs should be reported via email to security@ansible.com
The text was updated successfully, but these errors were encountered:
Summary
False positve for undefined variable in hosts.
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
Save the following playbook
as
test.yml
.Run
and get
Note, also
gives
Desired Behavior
No Errors from above playbook
Possible security bugs should be reported via email to
security@ansible.com
The text was updated successfully, but these errors were encountered: