Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Detecting if windows service is already installed using puppet exec

$
0
0
I have below exec resource which is used to install a window service. I want to it to execute only if the window service is not installed.So I have onlyif command but the command is not working it is running the install all the time. Any help regarding this appreciated. exec { "install-${target_path}/${binary_name}": command => "${installUtil_filepath} /i /servicename=\"${service_name}\" /displayname=\"${display_name}\" /description=\"${description}\" \"${target_path}\\${binary_name}\"", onlyif => "if((Get-Service \"${service_name}\" -ErrorAction SilentContinue).DisplayName -eq ${display_name}) { exit 1 } else { exit 0 }", logoutput => true, provider => powershell, }

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>