- From: David Sopscak <
>
- To:
- Subject: [chef] windows_service resource multiple actions?
- Date: Mon, 14 Sep 2015 12:32:01 -0500
I need to insure two things with respect to the Windows Time Service: it should be configured to run automatically and it must be started. If no action is taken in a recipe, the node comes up with the service set to manual and stopped. So I think the recipe must take two actions, but I can't seem to reliably get the desired behavior.
Initially, I thought each resource could only take one action, so I used:
windows_service 'Configure Windows Time' do
service_name 'W32Time'
action :configure_startup
startup_type :automatic
end
windows_service 'Start Windows Time' do
service_name 'W32Time'
action :start
end
That seemed to update the startup type to automatic, but did not start it. After further research, I got the impression that a single resource could have multiple actions, so I tried:
windows_service 'Configure Windows Time' do
service_name 'W32Time'
action :configure_startup
startup_type :automatic
action :start
end
That got it started, but left the startup type as manual.
How do I effectively take two actions on this service resource?
- [chef] windows_service resource multiple actions?, David Sopscak, 09/14/2015
Archive powered by MHonArc 2.6.16.