Add custom chef push work to Windows whitelist

I am trying to add a push task to the Windows white list for pushy-client. When I perform a search with a knife, it shows user work in the white list for Windows node. When I try to run it, the work immediately fails, and on the Windows side it says that the command is NOT in the white list.

I found this problem on GitHub: Windows push service cannot load whitelist

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

+1
source share
1 answer

Just confirming that I have the same problem after fully checking your script, I added a test command to the push-jobs cookbook whitelist directly in the attributes / default.rb file:

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

and confirmed that the whitelist contains these commands when it was written to C: \ chef \ push-jobs.client.rb on node I try to run the command after loading it using the cookbook push-jobs:

However, when I try to execute this command:

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

I also get an immediate failure:

 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 

I even restarted the Windows Pushy Client Service to make sure that it did not reload this configuration when the service was restarted.

The only way I was able to get the Windows server to run the jobs I want to run was to change the execution list before each standard chef-client command was run:

 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 

The error seems to be in the Windows Pushy Client Service itself, and there seems to have been no movement for your error.

+1
source

Source: https://habr.com/ru/post/1212051/


All Articles