check for role in ansible template

后端 未结 0 1904
长发绾君心
长发绾君心 2021-01-05 09:53

Is there a way to check inside a template if the host the template gets written to has a particular role?

{% if host.has_role(foo) %}
...
{% endif %}
<         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题