mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
- Introduced a new Chinese version of the README file (README_zh-CN.md) to enhance accessibility for Chinese-speaking users. - Updated the English README to reflect new features and installation instructions. - Added detailed documentation for project structure, playbooks, roles, tasks, and modules to improve user understanding and usability. Signed-off-by: [Your Name] <[Your Email]> Signed-off-by: redscholar <blacktiledhouse@gmail.com>
1.3 KiB
1.3 KiB
copy Module
The copy module allows users to copy files or directories to connected target hosts.
Parameters
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
| src | Source file or directory path | string | No (required if content is empty) | - |
| content | Content of the source file or directory | string | No (required if src is empty) | - |
| dest | Destination path on the target host | string | Yes | - |
Usage Examples
- Copy a relative path file to the target host
The relative path is under thefilesdirectory corresponding to the current task. The current task path is specified by the task annotationkubesphere.io/rel-path.
- name: copy relative path
copy:
src: a.yaml
dest: /tmp/b.yaml
- Copy an absolute path file to the target host
Local absolute path file:
- name: copy absolute path
copy:
src: /tmp/a.yaml
dest: /tmp/b.yaml
- Copy a directory to the target host
Copies all files and directories under the directory to the target host:
- name: copy dir
copy:
src: /tmp
dest: /tmp
- Copy content to a file on the target host
- name: copy content
copy:
content: hello
dest: /tmp/b.txt