假设我有一个名为my_cookbook::recipe_old.rb的食谱。此配方已应用于节点、角色等的运行列表。
但是,假设我需要将菜谱重命名为recipe_new.rb。如何更新所有节点和角色的运行列表?
我想我需要做一个knife search来查找所有节点和角色,然后将新命名的菜谱添加到他们的运行列表中,然后从他们的运行列表中删除旧的菜谱。
这是最好的方法还是厨师有更好的解决方案?
发布于 2016-09-13 20:08:01
就像这样
knife exec -E 'nodes.transform("*:*") {|n| n.run_list.each_index {|i| if n.run_list[i] == "recipe[my_cookbook::recipe_old]"; n.run_list[i] = "recipe[my_cookbook::recipe_new"; return true; end } false }'然后对roles.transform也有相似之处。
https://stackoverflow.com/questions/39477566
复制相似问题