Sof*_*fia 12 git shell ansible
在检查模式下,我想在服务器中显示当前提交.我正在使用shell命令(git rev-parse HEAD)来注册变量,然后打印/调试它,但ansible在检查模式下跳过shell命令.
无论如何将shell命令标记为在检查模式下运行是否安全?
或任何ansible模块做我想要的?我检查了git的模块,但它看起来只是检查.
任何输入将不胜感激.
jFr*_*tic 10
从Ansible 2.2开始,正确的方法是使用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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2436 次 |
| 最近记录: |