我们可以自动更新 Chef 节点属性吗?

Can we automate updating the chef node attributes?

我在 chef 节点中有一个具有以下 json 的节点:

 {
  "name": "app-node-01",
  "chef_environment": "dev",
  "run_list": [
  "recipe[hello-world]"
],
  "normal": {
    "app_version": "1.0.0",
    "tags": [

    ]
  }
}

我正在尝试寻找一种方法来管理 github 中的此 json 配置,当 app_version 的版本发生变化时,我会更新 [=25] =] 文件并将版本更新为 1.0.1 和 运行 像 knife node edit -c <json file from github> app-node-01 这样的命令命令将遍历 json 文件并更新节点厨师?这可能吗?

我在本地尝试了这个命令,但它打开了 VI 编辑器供我编辑。

我不想进行手动编辑,因为我正试图在 github 中寻找一种管理方法,就像任何其他厨师工件(数据包、环境文件、食谱等)一样

与其他 Chef 工件一样,节点也可以使用 from file 参数从文件更新。

而不是 knife node edit,您需要 运行:

knife node from file PATH_TO_JSON_FILE