Ansible template from jinja2

后端 未结 1 340
梦毁少年i
梦毁少年i 2021-01-26 12:16

Who can tell you how to implement the output of all regions in the name1 group when entering a template named region1a, and when entering a template named region2b, output all r

1条回答
  •  梦毁少年i
    2021-01-26 12:33

    Thank you all for your help. Still, I managed to figure it out myself. Here is the final solution:

    {% for country in AllCountry %}
    {% if item in lookup('vars', country) %}{% for count in lookup('vars', country) %} "My country = {{ count }}"{% if not loop.last %},{% endif %}{% endfor %}{% endif %}{% endfor %}
    

    0 讨论(0)
提交回复
热议问题