Updated on 2024-08-06 GMT+08:00

Copy Module Error

Symptoms

During the deployment of the action Ansible, if a custom playbook file is selected, an error message is displayed.

Cause Analysis

The src path is an absolute path when the copy or template module is used.

Solution

When the copy or template module is used, change the src path to a relative path that does not start with special characters (/\$~) or contain consecutive periods (..).

Usage of Copy and Template Modules

You are not allowed to copy folders if the copy and template modules are used in playbooks. Instead, you must copy the files to the directory where the .yml script is located, set the source directory (src) to the name of the files to be copied, and set the destination directory (dest) to the file path on the target host.

If the file name contains only digits (for example, 123654), enclose the file name with single quotation marks (') or double quotation marks ("), for example, '123654'.