how to put the result of an echo command into an ansible variable

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 19:33:21

The problem is that you are using the command module. Here's what the documentation says:

The given command will be executed on all selected nodes. It will not be processed through the shell, so variables like $HOME and operations like "<", ">", "|", and "&" will not work (use the shell module if you need these features).

So, use shell instead of command.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!