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
A task where the module directives are using jinja templating and the task has a vars directive that define variables used in the jinja templating causes a jinja[invalid] error to be reported.
if you're getting a stack trace, output of ansible-playbook --syntax-check playbook
$ ansible-lint --profile=production roles/aap_ocp_install/tasks/initialization.yml
WARNING Listing 1 violation(s) that are fatal
roles/aap_ocp_install/tasks/initialization.yml:13: jinja[invalid]: An unhandled exception occurred while running the lookup plugin 'ansible.builtin.template'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Unhandled exception when retrieving template_vars:
'ns_vars' is undefined. 'ns_vars' is undefined. Unhandled exception when retrieving template_vars:
'ns_vars' is undefined. 'ns_vars' is undefined
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
- jinja[invalid] # Rule that looks inside jinja2 templates.
Rule Violation Summary
count tag profile rule associated tags
1 jinja[invalid] basic formatting
Failed after min profile: 1 failure(s), 0 warning(s) on 1 files.
The text was updated successfully, but these errors were encountered:
Summary
A task where the module directives are using jinja templating and the task has a
vars
directive that define variables used in the jinja templating causes ajinja[invalid]
error to be reported.Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Fedora 36
Also verified using the quay.io/ansible/creator-ee:v0.9.2 container image
STEPS TO REPRODUCE
Task Definition causing failure:
Desired Behavior
The above task should not generate a
jinja[invalid]
errorActual Behavior
Please give some details of what is actually happening.
Include a minimum complete verifiable example with:
ansible-playbook --syntax-check playbook
The text was updated successfully, but these errors were encountered: