Mark unused variables in default/main.yml or vars/main.yml #1301
-
In my company we have +50 Ansible Roles and at least 50 Ansible Playbooks which require management regarding Ansible compatibility, Python updates, documentation and so on. We managed to find solutions for a few of the problems arising when using so many roles. One particular issue we cannot seem to fix is the usage of declared but unused variables in roles. E.g. I think ansible-lint is a perfect fit to check whether declared variables have a reference in a role. Maybe the support for this kind linting should be limited as some variables may only exist due to local facts or other means. Those facts existing at runtime should be out of scope for this idea. Also local scope variables which are created through set_facts or register can be ignored for this idea. There may be support for local variables (facts) in single tasks and/or imported or included facts. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Not possible. |
Beta Was this translation helpful? Give feedback.
Not possible.