Hey @Rahul thanks for a better question description.
So basically
Subelements goes through a list of dictionaries and then traverses a list with a given (nested sub-)key inside of those records.
Here the nested list is over the variable users
users:
- name: alice
authorized:
- /tmp/alice/onekey.pub
- /tmp/alice/twokey.pub
mysql:
password: mysql-password
hosts:
- "%"
- "127.0.0.1"
- "::1"
- "localhost"
privs:
- "*.*:SELECT"
- "DB1.*:ALL"
groups:
- wheel
- name: bob
authorized:
- /tmp/bob/id_rsa.pub
mysql:
password: other-mysql-password
hosts:
- "db1"
privs:
- "*.*:SELECT"
- "DB2.*:ALL"
ietm.0 refers the the first item in the list, in this case the username Alice and item.1 to Bob.
So when you encounter
item.0.name - it refers to Alice
item.0.mysql.password - refers to the mysql password of Alice and so on.