原文:ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory

命令: ansible i hosts st m shell a service zabbix agentd star K become ansible i hosts st m shell a lsof i: K become 在shell模块报错: FAILED rc gt gt bin sh: lsof: command not found 在command模块报错: rc gt gt Er ...

2017-08-16 19:09 0 6565 推荐指数:

查看详情

ansible远程执行shell报错:command not found

背景 项目中使用到了pm2,用于管理微服务的启停,我在相关机器上安装好了pm2,然后使用ansible进行批量启动服务。在使用ansibleshell模块执行远程命令时候却报了错:/bin/sh: pm2 :command not found,如下图 问题定位 1. 在被执行机器 ...

Fri Nov 27 16:37:00 CST 2020 0 502
ansible(4)--ansiblecommandshell模块

1. command模块 功能:在远程主机执行 shell 命令;为默认模块,可省略 -m 选项; 注意:不支持管道命令 |; command模块的常用参数如下: 参数 说明 chdir DIR 执行ansible ...

Thu Aug 19 00:45:00 CST 2021 0 158
jenkins 执行shell命令出错command not found 和No such file or directory

这里碰到了一个问题,我用Xshell远程登录到服务器,直接可以执行我的一个脚本,这个脚本里有一些命令是在PATH路径下的。 但是在Jenkins里面直接执行脚本却报错了,说是找不到这些命令,最后我在执行脚本前先export PATH = /home/.... 把PATH设置 ...

Tue Jul 31 19:44:00 CST 2018 0 4253
执行shell脚本报错-bash: ./startup.sh: /bin/sh^M: bad interpreter: No such file or directory

搭建nacos集群时,配置完毕后执行脚本报错,通过查询资料发现^M表示 Windows环境下dos格式文件传输到unix系统时,会在每行的结尾多一个^M,所以在执行的时候出现了这种现象,但是你在unix或者Linux环境下使用vi编辑的时候,会在下面显示此文件的格式,比如”sky8g.sh ...

Mon Apr 20 22:27:00 CST 2020 0 742
Ansible Command Shell Raw模块区别

Ansible可以执行命令的模块有三个:   command   shell   raw 应尽量避免使用这三个模块执行命令,因为其他模块大部分都是幂等性的,可以自动进行更改跟踪。 commandshell、raw不具备幂等性。 commandshell模块:   要求受 ...

Tue Mar 31 03:06:00 CST 2020 0 1998
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM