I'm trying to create client configs for each host in a group.  When the 
template is parsed the inventory set variable is not available in the 
template.

bareos/Defaults/main.yml

bareos_client_fileset: SomeFileSet


bareos/tasks/main.yml

- name: Install director client configs
  template:
    src: client.conf.j2
    dest: /etc/bareos/bareos-dir.d/clients/{{ item }}.conf
  with_items: "{{ groups['bareos_clients'] }}"


bareos/templates/client.conf.js

{{ hostvars[item]['bareos_client_fileset'] }}


How can I get the correct inventory variable from hostvars in this case?


-- 
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/3472a3c0-0a2a-4a14-bbd6-564709c9bee8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to