Help Center/ CodeArts Deploy/ FAQs/ Other Deployment Actions/ Ansible/ What Should I Do When the "Do not use the delegate_to, connection, hosts command in the Ansible PlayBook script for executing the local computer" message Is displayed When Running Ansible?
Updated on 2025-01-14 GMT+08:00

What Should I Do When the "Do not use the delegate_to, connection, hosts command in the Ansible PlayBook script for executing the local computer" message Is displayed When Running Ansible?

Symptom

The error message "Do not use the delegate command in the Ansible PlayBook script for executing the local computer" is displayed when running the Ansible action.

Cause Analysis

The user's Ansible file contains the hosts, delegate_to, or/and connection syntax and a specified host for execution such as localhost, 127.0.0.1.

Solution

The Ansible file cannot contain the local_action command.

Delete the IP address or host name of the local host from the delegate_to syntax.

  • If there are multiple IP addresses or host names, delete the local IP address and host name and retain others.
  • If there is only the IP address or host name of the local host, delete the entire line of delegate_to syntax.