[chef] Re: chef-provisioning / knife / test-kitchen support for running chef-client on windows via schtask


Chronological Thread 
  • From: Chris McClimans < >
  • To: Thom May < >
  • Cc:
  • Subject: [chef] Re: chef-provisioning / knife / test-kitchen support for running chef-client on windows via schtask
  • Date: Mon, 14 Sep 2015 09:11:19 -0400

It might be interesting to detect if we are running chef-client as windows service, schtask, or winrm.

It would allow us to throw a legible warning or error for cookbooks that require those escalated privileges running via schtask provides.

That would provide a delightful alternative to currently trying to decipher error codes from DSIM/wsus execute blocks.


On Mon, Sep 14, 2015 at 8:58 AM, Chris McClimans < " target="_blank"> > wrote:
That sounds great! Let me know if you need some testing done.

On Mon, Sep 14, 2015 at 8:55 AM, Thom May < " target="_blank"> > wrote:
It’s not especially hard to cause a scheduled task to run:
https://github.com/smurawski/chef-zero-scheduled-task/blob/master/lib/kitchen/provisioner/chef_zero_scheduled_task.rb is a scheduled task provisioner for t-k; i’m aiming to bring that down into mixlib-install this week so that it’s accessible to t-k’s core winrm provisioner and chef-provisioning. 

-- 
Thom May

On 14 September 2015 at 13:31:18, Chris McClimans ( " target="_blank"> ) wrote:

Using winrm for bootstrapping windows via chef-provisioning, knife bootstrap, and test-kitchen seems to be the norm, but it also seems to be the wrong way to run chef on windows.

It's been heavily suggested that we run chef-client as a schtask and not via winrm. (or even as a windows service)

I'd like to utilize all of our existing toolchain if possible, and one thought I had was to:

1. create a schtask for chef-client
2. find a way to run the schtask immediately, grab the output, and exit code
3. wrap all that up in a command to run via winrm, call it chef-client-task.bat
4. ????
5. Profit for our existing chef tooling!!!

I'm going to start looking into this approach, but I suspect there may be better alternative and would love to hear how other windows chef users do their day to day development and production work.

Thanks,
@hippiehacker
(from an RV in Burlington Vermont this week)





Archive powered by MHonArc 2.6.16.

§