thank you for all your replies. i changed the way i am organizing my file.
now i do:
my_files:
- {path: '/data/ansible/testing1', name: 'test1.reg', ext: '.reg'}
- {path: '/data/ansible/testing1', name: 'test1.lst', ext: '.lst'}
so it is less readable but easier to access to a variable
That's a complicated structure, and you seem to be storing some redundant
information.
Just wondering if you can simplify the structure and use filters to derive
the ext from the name
See
http://docs.ansible.com/ansible/playbooks_filters.html#other-useful-filters
- there's a splitext filter