Rewrite all access of attributes/methods not native to Ansible modules to use bracket notation #5

Open
opened 2025-12-16 17:04:24 +00:00 by admin · 0 comments
Owner

The Ansible YAML code should eventually be rewritten to abide by the following two rules for variable reference/use, before the project balloons too much in size:

  • Accessed attributes/methods that are not native to an Ansible module, or are from an object not native to Ansible or its modules, should use bracket notation for that access.
  • Accessed attributes/methods that are native to an Ansible module, or are from an object native to Ansible or its modules, should use dot notation for that access, unless the intention is to use a variable to specify the name of the attribute or method being accessed.

Following these rules make namespace conflicts less likely, and therefore reduces the likelihood of bugs.

The Ansible YAML code should eventually be rewritten to abide by the following two rules for variable reference/use, before the project balloons too much in size: - Accessed attributes/methods that are not native to an Ansible module, or are from an object not native to Ansible or its modules, should use **bracket notation** for that access. - Accessed attributes/methods that *are* native to an Ansible module, or are from an object native to Ansible or its modules, should use **dot notation** for that access, *unless the intention is to use a variable to specify the name of the attribute or method being accessed*. Following these rules make namespace conflicts less likely, and therefore reduces the likelihood of bugs.
admin added the qol/refactor label 2025-12-16 17:04:24 +00:00
admin self-assigned this 2025-12-16 17:04:24 +00:00
admin added this to the skato-ansible debugging project 2025-12-16 17:06:55 +00:00
admin moved this to Low Priority in skato-ansible debugging on 2025-12-16 17:07:20 +00:00
admin moved this to Needs Triage in skato-ansible debugging on 2025-12-16 17:07:49 +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#5