我想添加命令来将作业白名单推送到多个节点,而不是逐个编辑,有什么方法可以做到吗?
我已经试过了:
knife exec -E 'nodes.transform("name:A_NODE_NAME") do |n|
n.set["push_jobs"]["whitelist"]["ntpdate"] = "ntpdate -u time"
end'正如它所说的,here,但它不工作:
该命令运行良好,
knife exec -E 'nodes.transform("name:zookeeper03") do |n|
n.set["push_jobs"]["whitelist"]["dns"] = "chef-client -r system-configs::dns"
end'然后我使用knife node edit zookeeper03,编辑器向我展示
{
"name": "zookeeper03",
"chef_environment": "_default",
"normal": {
"tags": [
],
"push_jobs": {
"whitelist": {
"dns": "chef-client -r system-configs::dns"
}
}
}但是,当运行刀作业启动"dns“zookeeper03后,在该节点中的日志尾部,日志显示:
ERROR: [zookeeper03] Received commit c1fa30942d664c6df7213c71d79a74f3, but command 'dns' is not in the whitelist!有什么建议吗?
提前感谢
发布于 2019-04-01 19:46:07
被列入白名单的推送作业有一些bug。我执行了每一个步骤,比如在cookbook中添加白名单,以及更新https://docs.chef.io/install_push_jobs.html上提到的节点属性。还是不走运。它当前运行的唯一命令是来自推送作业的chef-client。否则,您可以使用以下步骤来执行此堆栈链接Add custom Chef push job to Windows whitelist中提到的任务
https://stackoverflow.com/questions/36847603
复制相似问题