我有以下要在Jinja2模板中使用的变量,但我不确定是否可能
tag: pony
这是我尝试使用它的方式:
{% if ansible_fqdn in groups['machines-{{ tag }}'] %}
{% for host in groups['machines-{{ tag }}'] %}
echo "Do some magic with my {{ tag }}"
{% endfor %}
{% endif %}
有可能吗?以及如何:) 谢谢!
答案 0 :(得分:0)
这对我有用
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table class="table table-bordered myTabl">
<tr style="background:#ff0">
<td>...</td>
</tr>
<tr style="background:#f00; font-size:12px">
<td>...</td>
</tr>
<tr style="background:#ff0">
<td>...</td>
</tr>
<tr style="font-size:12px; background : #f00">
<td>...</td>
</tr>
</table>