ansible-toolkit
ansible-toolkit copied to clipboard
find unused and duplicate variables
Help stop variable sprawl by finding unused and duplicate variables.
Sorry, just now saw your issues since github doesn't seem to want to notify me when new ones are created.
Anyway, I think I get the gist of your idea and think it's interesting, but could you flesh it out in a bit more detail what you think it would look like in practice? Maybe some simple examples would help.
in variables files, a foo: bar
that isn't references anywhere else in the code is unused.
Dupes could come in two types
-
foo: bar
on two separate precedence levels means the least default-y one doesn't need to be there -
foo: bar
andbaz: bar
could indicate accidental multiple variables for the same thing- similarly with
baz: "{{ foo }}"
- similarly with