Hi,

I have the following variables:

splunkforwarder_log_items:
  - source: "/var/log"
    app_name: "var_log"
    recursive: true
    index: "testindex"
    splunkforwarder_log_files:
      - logfile: "messages"
        name: "var_log"
        sourcetype: linux_messages_syslog



and the following task:

- name: drop props configuration
  template:
    src=props_conf.j2
    dest={{splunkforwarder_dir}}/etc/apps/{{item.0.app_name}}/props.conf
    owner=splunk
    group=splunk
    mode=640
  with_subelements:
    - splunkforwarder_log_items
    - splunkforwarder_log_files



Is it possible to use the variables from the subelement "
splunkforwarder_log_files" in the "props_conf.j2"-template? For example 
like this:

{% for sources in splunkforwarder_log_items.splunkforwarder_log_files %}
[source::.../{{sources.logfile}}]
sourcetype = {{sources.sourcetype}}
{% endfor %}



Or is there a simpler alternative?

Regards
Sebastian

-- 
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/6fa6b0f5-5bac-455c-bb8b-9cbd05ae5c76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to