I yamllint
ed all 44k YAML files I have read rights to on the system. The only duplicate keys I found were the ones I put there as a test. That’s a dead end.
The way I/we do projects’ collections is supposed to mimic the way AWX does it. In fact that part of our update-me
script was lifted from AWX source. Among other things, it does this:
if [ -f roles/requirements.yml ] ; then
ansible-galaxy install -r roles/requirements.yml -p ./roles/ --force
fi
if [ -f collections/requirements.yml ] ; then
export ANSIBLE_COLLECTIONS_PATH=./collections
ansible-galaxy collection install -r collections/requirements.yml -p ./collections/ --force-with-deps
fi
So I removed everything under collections/ansible-collections
and ran ansible-lint
. It was clean.
Then I ran ansible-galaxy collection install -r collections/requirements.yml -p ./collections/ --force-with-deps
, ran ansible-lint
again, and the “found a duplicate dict key” messages — all 114 of them — are back. I believe this tells me the problem is somewhere in these collections.
When I remove collections/ansible_collections/community/vmware
(4.0.0) , I’m down to 28 “found a duplicate dict key” messages.
After putting it back and removing collections/ansible_collections/community/general
(8.0.0), then ansible-lint
reports “found a duplicate dict key” 86 times. With the 28 from community.vmware
, that accounts for all 114 messages.
My original post shows “…constructing a mapping from , line…”, but actually the messages say “…constructing a mapping from <unicode string>, line…”. (I failed to backslash-escape the opening left-angle-bracket. Oops.) This indicates that at least at the level the message is generated, ansible-lint
is unaware of the provenance of the “<unicode string>” it’s reporting on.
I thought ansible-lint
was clever enough to ignore stuff that git
ignores. And yet:
INFO Loading ignores from .gitignore
INFO Excluded: .git
INFO Loading ignores from collections/ansible_collections/ansible/utils/.gitignore
That makes no sense to me, because according to git
, my .gitignore
ignores collections/ansible_collections/ansible
. So why would ansible-lint
consider loading ignores from collections/ansible_collections/ansible/utils/.gitignore
?