Hi All,

I have a list  ` logf_dest ` (of log files):

"logf_dest": [
        "/logs/mx/mail.log", 
        "/logs/dyn.log",  
        "/logs/apache-servers/other.log"
    ]

I need to form a "list of dicts" called ` logfile_config `, like the below:

- logfile_name: remote.conf
  logfile_pattern: /logs/mx/mail.log
  logfile_owner: root


- logfile_name: remote.conf
  logfile_pattern: /logs/dyn.log
  logfile_owner: root


- logfile_name: remote.conf
  logfile_pattern: /logs/apache-servers/other.log
  logfile_owner: root


I've come this far in doing so:

    - name: Create list of dicts
      set_fact:
        logfile_config: |
           {    
           {% for k in logf_dest %}
           logfile_name: remote.conf
           logfile_pattern: {{ k }}
           logfile_owner: root
           {% endfor %}
           }

But, above is obviously not formatted correctly.

I need help on what I am missing here. 

Thanks in advance.

-- 
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/61b38102-c346-495f-96e5-cd149800d4f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to