【ansible】shell,command,raw模块的区别
command,shell,raw模块都是ansible远程执行node服务器的一种指令模式 但是3个模块的适用还是有一定的区别。command模块
不是调用的shell的指令,所以没有bash的环境变量,也不能使用shell的一些操作方式,其他和shell没有区别
shell模块
调用的/bin/sh指令执行
raw模块
很多地方和shell类似,更多的地方建议使用shell和command模块。
但是如果是使用老版本python,需要用到raw,又或者是客户端是路由器,因为没有安装python模块,那就需要使用raw模块了
页:
[1]