cat main.yml

---

- name: Install and setup unison in nDeploy cluster master
  file: path=/root/.unison state=directory

- name: create the unison preference file
  template:
    src: default.prf.j2
    dest: /root/.unison/{{ item }}.prf
    with_items: groups['ndeployslaves']


cat default.prf.j2
# Unison preferences file
root = /home
root = ssh://root@{{ item }}//home
ignore = Path virtfs
ignore = Path */mail



However the item does not seem to be available in the template and I am 
getting the following error
TASK [unison_master : create the unison prefrence file] 
************************
fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "'item' is 
undefined"}



In short:

How to get the value of item variable in the task in a jinja template 
referenced in the same task?

Thanks in advance.
Anoop


-- 
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/023bdf55-e8fd-4778-9820-7423eeafc0eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to