ruby - how to install windows service using Chef Script -
here requirement : trying install windows service remote machine using chef. script should validate whether service installed or not. if installed delete , reinstall it.since new chef having tough time finding solution.
this have tried:
execute 'installing service testservice' command "sc create \"testservice\" binpath= d:/deploy/testservice.exe " action :run end
it installed service not able implement validation/check if exists , reinstall. don’t know whether above script standard one. can please here. it'll great if can suggest beginner level chef tutorial windows dotnet developer?
try removing service if exists powershell_script
block , notifies execute
block install/reinstall service. way installation fire after service removed.
powershell_script 'delete_if_exist' code <<-eoh $service = get-wmiobject -class win32_service -filter "name='testservice'" if ($service) { $service.delete() } eoh notifies :run, 'execute[installing service testservice]', :immediately end execute 'installing service testservice' command "sc create \"testservice\" binpath= d:/deploy/testservice.exe " action :nothing end
Comments
Post a Comment