0

I'm using Puppet for a custom system service (GitLab Runner in Docker). I want Puppet to set up and start the service, but I also want to be able to stop and restart it anytime (e.g. through SSH). I read about Puppet's service resource, but it doesn't tell how to control the services or whether it's possible at all.

In case this is not possible in Puppet, what is the best practice regarding this? Writing multiple service configs (e.g. systemd unit file, init.d shell scripts etc.)

1 Answers1

1

Puppet isn't really for ad-hoc stop/start/restart of services - it manages the desired state of a service. So for example

service 'myservice' {
  ensure => 'started'
}

A puppet agent run with the above configuration will ensure that the myservice service is started - and if it's not then it will start it, otherwise it will do nothing.

What you're looking for sounds more like something like Rundeck

Chris McKeown
  • 7,168
  • 1
  • 18
  • 26