Enable reserved variable name checks and fix violations (#12463)

* Enable reserved variable name checks and fix violations

Updated .ansible-lint configuration to skip only var-naming[pattern]
and var-naming[no-role-prefix] instead of skipping the entire var-naming rule.
This enables the check for reserved variable names.

Renamed variables that used reserved names to avoid conflicts.
Updated all references in tasks, variables, and templates.

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>

* Rename namespace variable inside tasks instead of deleting it

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>

* Change hosts variable to vm_hosts

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>

* Use k8s_namespace instead of dashboard_namespace in dashboard.yml.j2 template

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>

---------

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
This commit is contained in:
Ali Afsharzadeh
2025-08-21 11:17:07 +03:30
committed by GitHub
parent eb4f6d73fb
commit 303dd1cbc1
7 changed files with 19 additions and 17 deletions

View File

@@ -12,10 +12,12 @@ skip_list:
# (Disabled in June 2021)
- 'role-name'
# [var-naming] "defaults/main.yml" File defines variable 'apiVersion' that violates variable naming standards
# [var-naming]
# In Kubespray we use variables that use camelCase to match their k8s counterparts
# (Disabled in June 2021)
- 'var-naming'
- 'var-naming[pattern]'
# Variables names from within roles in kubespray don't need role name as a prefix
- 'var-naming[no-role-prefix]'
# [fqcn-builtins]
# Roles in kubespray don't need fully qualified collection names