ansible-playbook 有个一个failed_when,这个是什么时候会用到呢? 先看一个例子:
1 2 3 4 5 6 7 8 9 10 11 |
--- - hosts: localhost remote_user: root tasks: - name: command command: /bin/false ignore_errors: yes - name: another debug: msg: "this is the pring info" |
这个例子中,command 命令明显就会返回一个false , 这个时候ansible-playbook就知道这个task failed,但是,有些时候,我们是需要通……