0

I want to install an exe as windows service using a custom puppet module. The exe path i can put mannually, now can anyone help me with what should i code in the puppet manifest file.

I'm actually new to puppet so can anyone tell me the script for installing this exe as admin user.

Thank you.

  • It's helpful in Puppet to start by listing the steps you'd go through to do the task manually, then write the Puppet code to cover those tasks. If all you want to do is run a executable though then try looking here https://puppet.com/docs/puppet/7/types/exec.html but take care to use an onlyif, creates or unless to avoid it rerunning ever time the agent runs. – 16c7x Jun 13 '21 at 12:51
  • manually also i have to run the commands with admin rights. is there any way to execute these command with admin rights – xuan singh Jun 15 '21 at 04:02

1 Answers1

0

By far the recommended way will be to wrap the exe in a Nuget package. You can find some help here

Then, you can install the Nuget package via the package resource in Puppet.

If you do need to do it via say the exec resource, then @16c7x's statement is correct. Create exec resources with metadata to ensure it is idempotent. It is messy and not best practice though.

Werner
  • 791
  • 1
  • 6
  • 23