作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
在检查模式下,我想显示服务器中的当前提交。我正在使用 shell 命令 (git rev-parse HEAD
) 来注册变量,然后打印/调试它,但 ansible 在检查模式下会跳过 shell 命令。
有没有办法将 shell 命令标记为可以在检查模式下安全运行?
或者任何 ansible 模块来做我想做的事?我检查了 git 的模块,但它看起来只是检查。
如有任何意见,我们将不胜感激。
最佳答案
从 Ansible 2.2 开始,the right way to do it是使用check_mode: no
:
tasks:
- name: this task will make changes to the system even in check mode
command: /something/to/run --even-in-check-mode
check_mode: no
关于git - 如何在 ansible 检查模式下运行 shell 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30139810/
我是一名优秀的程序员,十分优秀!