kubekey/docs/zh/modules/set_fact.md
liujian b629ec57ad
feat: add module add_hostvars (#2629)
Signed-off-by: joyceliu <joyceliu@yunify.com>
2025-06-20 15:07:04 +08:00

446 B

set_fact 模块

set_fact模块允许用户将变量设置到当前执行的主机中生效。

参数

参数 说明 类型 必填 默认值
any 需要设置的任意参数 字符串或map -

使用示例

  1. 设置字符串参数
- name: set string
  set_fact:
    a: b
    c: d
  1. 设置map参数
- name: set map
  set_fact:
    a: 
      b: c