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>
54 lines
859 B
Markdown
54 lines
859 B
Markdown
# debug Module
|
|
|
|
The debug module lets users print variables.
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Description | Type | Required | Default |
|
|
|-----------|------------|------|---------|---------|
|
|
| msg | Content to print | string | Yes | - |
|
|
|
|
## Usage Examples
|
|
|
|
1. Print a string
|
|
```yaml
|
|
- name: debug string
|
|
debug:
|
|
msg: I'm {{ .name }}
|
|
```
|
|
If the variable `name` is `kubekey`, the output will be:
|
|
```txt
|
|
DEBUG:
|
|
I'm kubekey
|
|
```
|
|
|
|
2. Print a map
|
|
```yaml
|
|
- name: debug map
|
|
debug:
|
|
msg: >-
|
|
{{ .product }}
|
|
```
|
|
If the variable `product` is a map, e.g., `{"name":"kubekey"}`, the output will be:
|
|
```txt
|
|
DEBUG:
|
|
{
|
|
"name": "kubekey"
|
|
}
|
|
```
|
|
|
|
3. Print an array
|
|
```yaml
|
|
- name: debug array
|
|
debug:
|
|
msg: >-
|
|
{{ .version }}
|
|
```
|
|
If the variable `version` is an array, e.g., `["1","2"]`, the output will be:
|
|
```txt
|
|
DEBUG:
|
|
[
|
|
"1",
|
|
"2"
|
|
]
|
|
``` |