--check ),似乎 validate 未对运行命令 template 任务:
--check
validate
template
- name: Nginx is configured template: src: nginx.conf.j2 dest: /usr/local/etc/nginx/nginx.conf validate: /usr/local/sbin/nginx -t -c %s notify: Reload Nginx
我想你要找的是 check_mode: no 它有一个非常令人困惑的双负数名称,但实际上允许任务选择退出检查模式抑制。
check_mode: no
nginx 测试一下,离开 mv /tmp/nginx.conf /usr/local/etc/nginx/nginx.conf 而它 notify:
nginx
mv /tmp/nginx.conf /usr/local/etc/nginx/nginx.conf
notify: