i have this:
backups:
- mongodb
- postgresql:
- sonarqube
- other
- /opt
- /etc
later i use it in template task:
- name: template backup script out
template:
src: backup-script.sh.j2
dest: /root/backup.sh
mode: 755
my jinja2 is:
{% if backups.postgresql is defined %}
{% for db in backups.postgresql %}
{{ db }}
{% endfor %}
{% endif %}
expected output:
sonarqube
other
but got an empty output.
what's wrong in my template?
thank you!
--
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/d9bd0bf0-11b4-45db-8b94-2cd445a093a9n%40googlegroups.com.