explicit keys fields for looped custom dictionary list variables may collide with reserved keys attribute?
#11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I noticed that I would get errors when looping through a list of dictionary variables when the elements had a
keysattribute or field I had independently defined, which suggest to me it may be a reserved attribute in Ansible's system.Such loops began working again when I changed the dictionary list variable name--or the attribute name for each dictionary of the list variable--from
keysto (for example)ssh_keys.We should be on the lookout for other places in the code base in which
keys(or as to ensure, evenkey) is used as an attribute or property name, especially if the respective dictionary is used in a list that is intended to be looped through for a task module. Especially recommended is a review ofroles/init-server/install-pkgs.ymlas well asgroup_vars/*.yml'spkgsvariable.