📜  ansible 总是在最后运行任务 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:56.350000             🧑  作者: Mango

代码示例1
# Use block and always, which executes its tasks no matter what happens
# in the block tasks.
- name: Always do X
   block:
     - debug:
         msg: 'I execute normally'
     - name: i force a failure
       command: /bin/false
     - debug:
         msg: 'I never execute :-('
   always:
     - debug:
         msg: "This always executes, :-)"