Ask Your Question
0

Stop Service, Replace files, then start service again

asked 2017-01-03 16:04:26 -0500

dj50x gravatar image

In my infrastructure we make use SoftEther as a vpn client. I need to upgrade all the clients. Unfortunately after very extensive checking even going through the source I found out SoftEther has no silent installer. However, after taking a snapshot of the hard drive and registry I've gone through every change the installer makes well upgrading. I basically just need to stop the softether service on windows, replace a bunch of exe's then restart the service. I wrote a powershell script that does just this and have tested it as being very reliable at upgrading the client. Now, I'm trying to figure out how to write a module that would maintain softether on all of our windows desktops. I could probably just use the powershell module to execute my script but that isn't very 'puppet' and I'd probably have to manually transfer all the files? Is there a better way of doing this? or can I access a modules files from the puppet masters IP? I'm pretty familiar with puppets dsl at this point but I'm also still fairly new.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-01-04 10:40:29 -0500

MichaelSmith gravatar image

https://forge.puppet.com/puppetlabs/t... can be used to do what you ask: stop a service, make other changes, then start the service.

You could also continue to use the PowerShell script, but to use Puppet's file distribution you'd probably want to stage the files locally via File resources first. You can directly retrieve files from the master via https://github.com/puppetlabs/puppet/...filecontent.md, but that starts to get harder to maintain (it introduces multiple places defining where the master can be found).

edit flag offensive delete link more

Comments

I always forget about the transition module, great suggestion!

DarylW gravatar imageDarylW ( 2017-01-04 11:50:23 -0500 )edit

That's transition resource is actually perfect. It also works pretty well with a few other things I'm doing. I'm mildly surprised it isn't a standard resource..

dj50x gravatar imagedj50x ( 2017-01-06 08:52:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-01-03 16:04:26 -0500

Seen: 64 times

Last updated: Jan 04