explicit keys fields for looped custom dictionary list variables may collide with reserved keys attribute? #11

Closed
opened 2026-05-29 18:10:07 +00:00 by admin · 0 comments
Owner

I noticed that I would get errors when looping through a list of dictionary variables when the elements had a keys attribute 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 keys to (for example) ssh_keys.

We should be on the lookout for other places in the code base in which keys (or as to ensure, even key) 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 of roles/init-server/install-pkgs.yml as well as group_vars/*.yml's pkgs variable.

I noticed that I would get errors when looping through a list of dictionary variables when the elements had a `keys` attribute 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 `keys` to (for example) `ssh_keys`. We should be on the lookout for other places in the code base in which `keys` (or as to ensure, even `key`) 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 of `roles/init-server/install-pkgs.yml` as well as `group_vars/*.yml`'s `pkgs` variable.
admin added this to the debug bootstrapping of armitage milestone 2026-05-29 18:10:07 +00:00
admin added the fix/semantic_error label 2026-05-29 18:10:07 +00:00
admin self-assigned this 2026-05-29 18:10:07 +00:00
admin added this to the skato-ansible debugging project 2026-05-29 18:10:07 +00:00
admin pinned this 2026-05-29 18:11:53 +00:00
admin closed this issue 2026-06-10 19:39:45 +00:00
admin unpinned this 2026-06-10 19:39:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/skato-ansible#11