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.2 KiB
1.2 KiB
template Module
The template module allows users to parse a template file and copy it to the connected target host.
Parameters
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
| src | Path to the original file or directory | string | No (required if content is empty) | - |
| dest | Destination path on the target host | string | Yes | - |
Usage Examples
- Copy a relative path file to the target host
Relative paths are under the
templatesdirectory of the current task. The current task path is specified by the task annotationkubesphere.io/rel-path.
- name: copy relative path
template:
src: a.yaml
dest: /tmp/b.yaml
- Copy an absolute path file to the target host Local template file with an absolute path
- name: copy absolute path
template:
src: /tmp/a.yaml
dest: /tmp/b.yaml
- Copy a directory to the target host Parse all template files in the directory and copy them to the target host
- name: copy dir
template:
src: /tmp
dest: /tmp
- Copy content to the target host
- name: copy content
template:
content: hello
dest: /tmp/b.txt