Hi,

I am new to ansible and new to the form.

I am wondering how to loop through a template

my template looks like this


{ item.sitename  }}-test,{{ item.sitename  }} description

 and my variables look like this

---
parameters:
  - { sitename: testsite1  }
  - { sitename: testsite2  }

my Task looks like this

---
- name: Lines Templates
  template: src=test.j2 dest=../ansible/configurations/test.csv
  with_items: "{{ parameters }}"

this works but I only get the one line of the last entry  with looks like 
this

testsite2-test,testsite2 description


But what I am tring to get is this


testsite1-test,testsite1 description
testsite2-test,testsite2 description


I have been looking and reading the Jinga2 Templates doc but truble finding 
which {% for in %} to use

if some one could point me to the right direction that would be great.


Jeff








-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8694b369-eeae-4deb-a1f7-72d4336f6ae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to