我有以下3本剧本。当其中一个播放失败时,下一个播放仍会执行。我认为这是因为我在不同的宿主目标下运行这些游戏。
我想避免这种情况,让一部剧本失败时停止剧本,这有可能吗?
---
- name: create the EC2 instances
hosts: localhost
any_errors_fatal: yes
connection: local
tasks:
- ...
- name: configure instances
hosts: appserver
any_errors_fatal: yes
gather_facts: true
tasks:
- ...
- name: Add to load balancer
hosts: localhost
any_errors_fatal: yes
vars:
component: travelmatrix
tasks:
- ...
您可以使用any_errors_fatal在出现任何错误时停止播放。
- name: create the EC2 instances
hosts: localhost
connection: local
any_errors_fatal: true
tasks:
- ...
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句