--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5e6a8d23-4835-44c2-9902-5ec3a49feebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
my_list: |
{%- set names = [] -%}
{%- for item in my_dict if item.item_en -%}
{%- do names.append(item.name) -%}
{%- endfor -%}
{{ names }}
[defaults]
jinja2_extensions = jinja2.ext.do
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@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/5e6a8d23-4835-44c2-9902-5ec3a49feebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Also, another quick question. If I was using my_dict in a task loop, could i put a condition on:
with_items: my_dictwhen: item.key is definedwill that work?
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/VerPXFuLUb0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6f3689d8-51e5-4fdb-ac81-2b7f43b81ccb%40googlegroups.com.
---
foobar_config_path: "/etc/foobar"
foobar_foomatic_file: "{{ foobar_config_path }}/foomatic.conf"
greeting: "Hello {% for host in groups['all'] %}{{ host }}, {% endfor %} and everybody else!"
block_string: |
This is just a convenient YAML way for assigning multi-line strings to a variable,
possibly with {{ 'splendid' if datacenter_location == 'UK' else 'awesome' }} magic
embedded in it...