I have put different playbooks within several directories in the gitlab repository and would like to execute ansible-lint to validate my playbooks. In one of the playbooks, I have utilized an undefined variable (intended to provide the value as an environmental variable), which caused ansible-lint to fail with the error shown below.
lint_output='ttps://ansible.readthedocs.io/projects/lint/rules/syntax-check/yntax-check[specific]: The field '\''hosts'\'' has an invalid value, which includes an undefined variable.. '\''target_host'\'' is undefined
playbook.yml:2:3
Despite attempting multiple options to bypass this error, I couldn’t succeed. Could anyone provide any suggestions to resolve this issue?
Yes, i have seen that issue. It is still open. Do we have any workaround where we can ignore this errors while running ansible-lint, because of this i am getting failed error.
Hello Selvi, I am learning ansible on my lab, can you send me your playbook which is generating errors while running ansible-lint. i want to have a look to reproduce the error and try to fix.