Summary
Using uppercase variables in tasks are reported as `var-naming: Task defines variables within 'vars' section that violates variable naming standards´. The same variables for blocks are not reported.
Issue Type
Ansible and Ansible Lint details
$ ansible --version
ansible [core 2.12.2]
$ ansible-lint --version
ansible-lint 5.4.0 using ansible 2.12.2
- ansible installation method: pip
- ansible-lint installation method: pip
OS / ENVIRONMENT
Fedora 35
STEPS TO REPRODUCE
Using ansible-lint on this playbook
---
- name: Test
hosts: localhost
tasks:
- block:
- name: foo1
debug: msg="{{ FOO }}"
vars:
FOO: fooo1
- name: foo2
debug: msg="{{ FOO }}"
vars:
FOO: fooo2
results in
Failed to guess project directory using git:
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: test.yml
WARNING Listing 1 violation(s) that are fatal
var-naming: Task defines variables within 'vars' section that violates variable naming standards
test.yml:12 Task/Handler: foo2
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list: # or 'skip_list' to silence them completely
- experimental # all rules tagged as experimental
Finished with 0 failure(s), 1 warning(s) on 1 files.
Desired Behavior
The issue needs to be reported for the task and the block.
Actual Behavior
The issue is only reported for the task, but not the block.
Summary
Using uppercase variables in tasks are reported as `var-naming: Task defines variables within 'vars' section that violates variable naming standards´. The same variables for blocks are not reported.
Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Fedora 35
STEPS TO REPRODUCE
Using ansible-lint on this playbook
results in
Desired Behavior
The issue needs to be reported for the task and the block.
Actual Behavior
The issue is only reported for the task, but not the block.