I would like to understand semantics of `with_items` in ansible and compare this approach to `map` for example.
For example, let consider: `{{ ["1","2", "3"] | map('regex_replace', '^(.*)$', \1'some tail') tail }}` How to reach the same effect using `with_items` ? And in general how does it work ? Where is the body of this loop ? For example (got from some stack overflow thread): --- - hosts: localhost tasks: - name: set fact 1 set_fact: foo="[ 'zero' ]" - name: set fact 2 set_fact: foo="{{ foo }} + [ 'one' ]" - name: set fact 3 set_fact: foo="{{ foo }} + [ 'two', 'three' ]" - name: set fact 4 set_fact: foo="{{ foo }} + [ '{{ item }}' ]" with_items: - four - five - six - debug: var=foo To sum up, the question is about which approach is better (`map` vs `with_items`) and possible details of working (e.g. where is body of this loop) Each detail of working ansible is welcome! -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/70e4f30e-b8b7-4d2f-807a-c10d5fbde686%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.