在when语句中我需要一个if条件。我该怎么办?
现在看起来像这样:
when: {% if routes is defined %}'celery' is in routes{% else %}inventory_hostname in groups['celery']{% endif %} and deploy_state.colors.celery is defined
答案 0 :(得分:0)
我认为可能是
when: (((routes is defined) and ('celery' is in routes)) or
(inventory_hostname in groups['celery'])) and
(deploy_state.colors.celery is defined)