- From: Grzegorz Marszałek <
>
- To:
- Subject: [chef] lwrp resources could be notified?
- Date: Tue, 22 Mar 2011 16:37:03 +0100
Hello!
I've written small lwrp provider called windows_service (original service
provider is ununsable on windows in version other than english). Now I'm
trying to send notification to it, it looks something like that
ultravnc = "c:\uvnc"
template "#{ultravnc}/ultravnc.ini" do
backup false
source "ultravnc.ini.erb"
variables :ultravnc_path => ultravnc.gsub("/","\\")
notifies :restart, "windows_service[dfclient_vnc]"
end
windows_service "dfclient_vnc" do
action :nothing
end
Unfortunately - service NEVER is restarted! Provider looks like this:
action :start do
log "Starting windows service"
execute "net start #{new_resource.name}" do
only_if "sc query #{new_resource.name}"
end
end
action :stop do
log "Stopping windows service"
execute "net stop #{new_resource.name}" do
only_if "sc query #{new_resource.name}"
end
end
action :restart do
log "Restarting windows service"
log "Stopping windows service" do
level :debug
end
execute "net stop #{new_resource.name}" do
only_if "sc query #{new_resource.name}"
ignore_failure true
end
log "Starting windows service" do
level :debug
end
execute "net start #{new_resource.name}" do
only_if "sc query #{new_resource.name}"
end
end
And provider is defined in windows cookbook, which my cookbook depends on.
Logs shows:
...
[Tue, 22 Mar 2011 16:28:21 +0100] DEBUG: Processing
windows_service[dfclient_vnc
] on 0000-dragonfly_GRAF0-KOMPUTER
[Tue, 22 Mar 2011 16:28:21 +0100] DEBUG: Doing nothing for
windows_service[dfcli
ent_vnc]
[Tue, 22 Mar 2011 16:28:21 +0100] INFO:
template[C:/df/opt/ultravnc/ultravnc.ini
] sending restart action to windows_service[dfclient_vnc] (delayed)
[Tue, 22 Mar 2011 16:28:21 +0100] DEBUG: Saving the current state of node
0000-d
ragonfly_GRAF0-KOMPUTER
[Tue, 22 Mar 2011 16:28:21 +0100] DEBUG: Signing the request as
0000-dragonfly_G
RAF0-KOMPUTER
That's all! No output from log resource, no output from execute. Any ideas?
---
Grzegorz Marszałek
- [chef] lwrp resources could be notified?, Grzegorz Marszałek, 03/22/2011
Archive powered by MHonArc 2.6.16.