I'm trying to do this with ansible:
I have multiple "fruits" and want to distrubute to multiple kids:
- vars:
kids:
- John
- Shara
- David
fruits:
- Banana
- Mango
- Orange
- Peach
- Pineapple
- Watermelon
- Avocado
- Cherries
Desidered result, something like this:
John:
- Banana
- Peach
- Avocado
Shara:
- Mango
- Pineapple
- Cherries
David:
- Orange
- Watermelon
I tried with zip, zip_longest, list, but no way.
ansible.builtin.debug:
msg: "{{ item | zip(['a','b','c','d','e','f']) | list }}"
loop:
- John
- Shara
- David
For example
gives
Q: "Have more than 4 kids"
A: For example
gives