On Wed, 15 Jan 2020 09:45:41 -0800 (PST)
Xinhuan Zheng <[email protected]> wrote:

> *I still cannot figure out how to loop through my variable:*
> 
> *sssd_config:*
> *  sssd:*
> *    debug_level: 1*
> *  nss:*
> *    reconnection_retries: 3*
> * pam:*
> *  debug_level: 5*
> 
> Here is my template code:
> 
> {% for item in sssd_config %}
> [{{ item }}]

Variable 'sssd_config' is dictionary. It's not possible to iterate
dictionary. Try for example

  {% for item in sssd_config.items() %}
  {{ item }}
  {% endfor %}

see the 'items' in the created file and fit the template to your needs.

HTH,

        -vlado

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200115193544.3e66a74b%40gmail.com.

Attachment: pgp2JoGdePfu8.pgp
Description: OpenPGP digital signature

Reply via email to