I would like to filter on value that contain or start with 'foo_' and ignore other values in list.
values (Can not be modified):
TEST:
- foo_a
- foo_b
- bar_a
- bar_b
- test_c
Template :
{% for value in grains['TEST'] %}
- do something with value that contains "foo_"
{% endfor %}
How can i do it?
I tried with :
{% for value in grains['TEST']|map(^foo_) %}
- do something with value that contains "foo_"
{% endfor %}
=> No success
{% for value in grains['TEST'] if value.startswith('foo_') %} -do something {% endfor %}- Avinash Raj