Winning at Ansible: How to manipulate items in a list(blog.caranna.works) |
Winning at Ansible: How to manipulate items in a list(blog.caranna.works) |
If you need to iterate over the items you can just use "with_items" or "with_subelements" (http://docs.ansible.com/ansible/playbooks_loops.html#looping...) and the "{{ item }}_12345"
If you need a list for a template you can always loop it in the template and access the sublements there and template them as you wish.
One of the strong points of Ansible is that it can be read very easily. The moment you do:
"{{ important_files | map(attribute='file_name') | list | map('regex_replace','(.*)','\\1_{{ file_suffix }}') | list }}"
you throw it away.