I see your viewpoint, but I personally feel that YAML is a much better solution. I don't want to run arbitrary code in my playbooks! I just want to be able to trigger ansible modules.
Besides, it's really easy to write your own Ansible module (in Python), which seems to solve the issue for any use case I can think of?
You're talking about eliminating duplicates in a list right?
my_list | unique
I think this is what you're looking for. Any transformation of data that can't be done with the standard filters can be done with a simple filter plugin written in python.
>You're talking about eliminating duplicates in a list right?
No, I'm talking about any atbitrary list processing operation. Some combination of map, fold, and filter, for example.
So, in order to do that in an Ansible playbook, I need to write a Python function to do it and use it in the YAML file as a filter because the DSL isn't expressive enough to do it on its own. So... why wouldn't I want to just use Python again?
Besides, it's really easy to write your own Ansible module (in Python), which seems to solve the issue for any use case I can think of?