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
With ANSIBLE_ROLES_PATH set to e.g.:
ANSIBLE_ROLES_PATH=roles/services:roles/base:roles/contrib
no-role-prefix appears to be picking up the directory before the module as the module name when linting yml in the 'defaults' dir. e.g.:
var-naming[no-role-prefix]: Variables names from within roles should use services_ as a prefix. (vars: proxy_env)
roles/services/signiant_agent/defaults/main.yml:15
This only seems to happen when linting defaults files - yaml under vars is OK.
Issue Type
Bug Report
OS / ENVIRONMENT
ansible-lint --versionansible-lint 6.22.0 using ansible-core:2.16.0 ansible-compat:4.1.10 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.8
ansible installation method: one of source, pip, OS package
ansible-lint installation method: one of source, pip, OS package
Both pip installed on bookworm-slim docker base image
STEPS TO REPRODUCE
Set ANSIBLE_ROLES_PATH=roles/services
Run ansible-lint on a module under roles/services, e.g. roles/services/mything
Observe that 'services_' is the suggested prefix for variables in defaults/main.yml
Desired Behavior
no-role-prefix should suggest variable names based on the module name, rather than its parent directory
Possible security bugs should be reported via email to [email protected]
Actual Behavior
no-role-prefix detects the directory above the module as the module name
var-naming[no-role-prefix]: Variables names from within roles should use services_ as a prefix. (vars: signiant_agent_sha)
roles/services/signiant_agent/defaults/main.yml:2
var-naming[no-role-prefix]: Variables names from within roles should use services_ as a prefix. (vars: signiant_agent_install)
roles/services/signiant_agent/defaults/main.yml:3
The text was updated successfully, but these errors were encountered:
Summary
With ANSIBLE_ROLES_PATH set to e.g.:
ANSIBLE_ROLES_PATH=roles/services:roles/base:roles/contrib
no-role-prefix appears to be picking up the directory before the module as the module name when linting yml in the 'defaults' dir. e.g.:
var-naming[no-role-prefix]: Variables names from within roles should use services_ as a prefix. (vars: proxy_env)
roles/services/signiant_agent/defaults/main.yml:15
This only seems to happen when linting defaults files - yaml under vars is OK.
Issue Type
OS / ENVIRONMENT
Both pip installed on bookworm-slim docker base image
STEPS TO REPRODUCE
Set ANSIBLE_ROLES_PATH=roles/services
Run ansible-lint on a module under roles/services, e.g. roles/services/mything
Observe that 'services_' is the suggested prefix for variables in defaults/main.yml
Desired Behavior
no-role-prefix should suggest variable names based on the module name, rather than its parent directory
Possible security bugs should be reported via email to
[email protected]
Actual Behavior
no-role-prefix detects the directory above the module as the module name
Please give some details of what is happening.
Include a minimum complete verifiable example with:
ansible-playbook --syntax-check playbook
With the following in roles/services/signiant_agent/defaults/main.yml:
ansible-lint fails with:
The text was updated successfully, but these errors were encountered: