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

570 B

add_hostvars 模块

add_hostvars模块允许用户将变量设置到指定的主机中生效。

参数

参数 说明 类型 必填 默认值
hosts 需要设置参数的目标主机 字符串或字符串数组 -
vars 需要设置的参数 map -

使用示例

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