文档首页/ 部署 CodeArts Deploy/ 常见问题/ 其他部署步骤问题/ Ansible/ 执行Ansible提示Do not use the delegate_to, connection, hosts command in the Ansible PlayBook script for executing the local computer,怎样处理?
更新时间:2025-01-14 GMT+08:00
分享

执行Ansible提示Do not use the delegate_to, connection, hosts command in the Ansible PlayBook script for executing the local computer,怎样处理?

问题现象

执行Ansible步骤插件时,出现Do not use the delegate command in the Ansible PlayBook script for executing the local computer.日志提示。

原因分析

用户的ansible文件中包含了hosts、delegate_to、connection语法并且有指定在本机执行的主机,如localhost,127.0.0.1等。

处理办法

用户的ansible文件不能包含local_action命令。

删除delegate_to语法中的执行本机的IP或者主机名。

  • 如果有多个IP或主机名,则删除本机IP和本机主机名,保留其他IP或主机名。
  • 如果只有本机IP或本机主机名,则删除delegate_to整行语句。

相关文档