Hi, my goal is to use multiple dictionaries within a template. I want one file per username with all projects in it of this user. My playbook looks like:
- name: create files template: src=vhost.conf.j2 dest=/tmp/{{ item.0.username }}.conf with_subelements: - "{{ users }}" - projects vars: users: - username: jon password: 123456 sftp: True projects: - projectname: Projekt1 documentroot: root1 - projectname: Projekt2 documentroot: root2 - username: jane password: 123456 projects: - projectname: Projekt3 documentroot: root3 - projectname: Projekt4 documentroot: root4 How does a working {% for %} loop needs to look like in the template file? Let's say I want to insert all projectnames of each username in a per username file? Thanks for helping me out! -- 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/1cbe42a1-6f9c-4981-96d9-6ff5e6c10dad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.