Hoping for a hand with this, I haven't been able to get the logic right.
I have the following YAML list:
- name: admin1
full_name: Admin 1
- name: admin2
full_name: Admin 2
- name: paul
- name: munin
groups: [sudo, kids]
I'm trying to extact a list of kids' account names, i.e. list of users that have 'kids' in their groups attribute (which is itself a list). For the above data, the desired outcome is to produce the following list to work with:
I tried to fit this into map() and selectattr() approaches but couldn't figure out how to structure a test to evaluate inclusion of a value in a list.