- From: "Moser, Kevin" <
>
- To: "
" <
>
- Subject: [chef] Re: Re: Modifying Windows Service Logon As
- Date: Tue, 7 Jan 2014 16:05:18 +0000
- Accept-language: en-US
You could add a logon_user, logon_password to the resource and then in the
provider add:
service = {
:service_name => @new_resource.name,
:binary_path_name => @new_resource.binary_path_name,
:display_name => @new_resource.display_name,
:description => @new_resource.description,
:start_type => start_type
}
service[:service_start_name] = new_resource.logon_user if
new_resource.logon_user
service[:password] = new_resource.password if new_resource.password
::Win32::Service.create(service)
You'd probably want to add a config action, or in create compare the config
so that people can modify attributes about the service, like logon user,
after it's already created.
Kevin
From: James Kessler
<
<mailto:
>>
Reply-To:
"
<mailto:
>"
<
<mailto:
>>
Date: Monday, January 6, 2014 3:07 PM
To:
"
<mailto:
>"
<
<mailto:
>>
Subject: [chef] Re: Modifying Windows Service Logon As
I added a resource to the Windows cookbook to create/delete services. I'm not
sure about the "Log On As" parameter but this should get you started:
https://github.com/jkess/windows/blob/service/providers/service.rb
On Fri, Jan 3, 2014 at 11:46 AM, Kamil Markowicz
<
<mailto:
>>
wrote:
Hello Chefs,
We are currently evaluating Chef as a management tool for our Windows
platform. We are playing around with some of the built in resources, and it
did not take long to realize that crucial features are missing.
One of the items that is important to us is manipulating Windows services,
specifically, the "Log On As" parameter. We need to be able to run Windows
services under various (local and AD-authenticated) accounts.
We would prefer to have an abstracted way of doing this (i.e. not defining
custom CMD/Powershell for each recipe that manipulates a service), for
example by having logonas_user/logonas_password attributes for the service
resource.
What documentation topics should we look at? Ideally, we'd like to somehow
extend the existing Service resource (provider?). Should we look at
developing a custom resource?
I am still somewhat intimidated some of the terminology, so I'd appreciate
some pointers to the documentation or maybe examples of others doing similar
work.
Thanks for your tips,
- Kamil
Archive powered by MHonArc 2.6.16.