将自定义Chef推送作业添加到Windows白名单 [英] Add custom Chef push job to Windows whitelist

查看:76
本文介绍了将自定义Chef推送作业添加到Windows白名单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将push作业添加到pushy-client的Windows白名单中。当我用刀进行搜索时,它在Windows节点的白名单中显示了自定义作业。当我尝试运行它时,该作业立即失败,并且在Windows端显示该命令不在白名单中。

I am trying to add a push job to the Windows whitelist for the pushy-client. When I do a search with knife it shows the custom job in the whitelist for the Windows node. When I try to run it, the job immediately fails and on the Windows side it says the command is NOT in the whitelist.

我在GitHub中发现了此问题: Windows推送服务无法加载白名单

I found this issue in GitHub: Windows push service can't load whitelist

我想知道如果有人有变通办法,请提出解决方案的建议,或者知道我可以在代码的哪个位置进行猴子补丁。

I was wondering if anyone has a workaround, suggestion on how to fix it, or knows where in the code this lives that I could monkey-patch.

推荐答案

仅在确认对您的方案进行了完全测试之后,我仍然遇到相同的问题,我在 attributes / default.rb 文件中将测试命令添加到了push-jobs菜谱本身的白名单中:

Just confirming I get the same issue after fully testing your scenario, I added a test command to the white list of the push-jobs cookbook itself in the attributes/default.rb file:

default['push_jobs']['whitelist'] = { 'chef-client' => 'chef-client', 'new-command' => 'chef-client' }

,并验证白名单在写入<我在使用push-jobs食谱自举命令后尝试在该节点上运行strong> C:\chef\push-jobs.client.rb :

and verified that the white list contains those commands when it was written to C:\chef\push-jobs.client.rb on the node I am attempting to run the command on after bootstrapping it with the push-jobs cookbook:

但是,当我尝试执行该命令时:

However, when I attempt to execute that command:

knife job start --timeout 600 'new-command' server.fqdn

我也立即失败:

Started.  Job ID: db3a99728dbded7abd35ed40d4ec3d5f
Quorum_failed.
command:     new-command
created_at:  Thu, 19 Nov 2015 23:31:57 GMT
id:          db3a99728dbded7abd35ed40d4ec3d5f
nodes:
    nacked: server.fqdn
run_timeout: 600
status:      quorum_failed
updated_at:  Thu, 19 Nov 2015 23:31:57 GMT

我什至重新启动了 Pushy Client Service Windows服务,只是为了验证它在服务重新启动时是否不会重新加载该配置。

I even restarted the Pushy Client Service windows service just to verify it didn't reload that config on service restart.

我能够让Windows服务器运行我要运行的作业的唯一方法是在每次运行标准 chef-client 命令之前修改运行列表:

The only way I have been able to get the windows server to run the jobs I want it to run has been to modify the runlist before each run of the standard chef-client "command":

knife node run_list set server.fqdn 'recipe[cookbook::recipe1]'

knife job start --timeout 600 'chef-client' node.fqdn

knife node run_list set server.fqdn 'recipe[cookbook::recipe2]'

knife job start --timeout 600 'chef-client' node.fqdn

错误似乎o位于Pushy Client Service Windows服务本身中,而且您提交的错误似乎没有任何变化。

The bug seems to be in the Pushy Client Service windows service itself and there doesn't seem to be any movement on the bug you submitted.

这篇关于将自定义Chef推送作业添加到Windows白名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆