kubekey/docs/en/modules/result.md
liujian 192af7bb7e
feat: add Chinese README and documentation updates (#2791)
- 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>
2025-09-30 10:00:07 +08:00

1.2 KiB

result Module

The result module allows users to set variables to be displayed in the playbook's status detail.

Parameters

Parameter Description Type Required Default
any Any parameter to set string or map No -

Usage Examples

  1. Set string parameters
- name: set string
  result:
    a: b
    c: d

The status in the playbook will show:

apiVersion: kubekey.kubesphere.io/v1
kind: Playbook
status:
  detail:
    a: b
    c: d
  phase: Succeeded
  1. Set map parameters
- name: set map
  result:
    a: 
      b: c

The status in the playbook will show:

apiVersion: kubekey.kubesphere.io/v1
kind: Playbook
status:
  detail:
    a:
      b: c
  phase: Succeeded
  1. Set multiple results
- name: set result1
  result:
    k1: v1

- name: set result2
  result:
    k2: v2

- name: set result3
  result:
    k2: v3

All results will be merged. If there are duplicate keys, the last set key will take precedence. The status in the playbook will show:

apiVersion: kubekey.kubesphere.io/v1
kind: Playbook
status:
  detail:
    k1: v1
    k2: v3
  phase: Succeeded