最新在使用 ansible,也看了下 ansible 的 python api,发现里面有个 check 和 diff 模式
从官方文档的解释是这样 “当以 --check 参数来运行 ansible-playbook 时,将不会对远程的系统作出任何更改.” 从-h 中看到 “ -C, --check don't make any changes; instead, try to predict some of the changes that may occur -D, --diff when changing (small) files and templates, show the differences in those files; works great with --check ”
但其实还是不明白,尤其是使用 command 或者 shell 模块的时候,更是一点区别也感觉不出来,求大神解释,谢谢