O'Reilly logo

Learning Puppet for Windows Server by Fuat Ulugay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing services

Puppet resource type service is used to manage services. In Windows, the management capabilities are somewhat limited. However, if we want to make sure that a service always runs or always stops, we can use the service type.

Here is how to write this:

service { 'servicename':
ensure =>running,stopped
enable =>true,false,manual
  }

The following points explain the preceding code:

  • First line is the service name in Windows.
  • ensure => running makes sure that the service is running. You can also use stopped option to make sure that the service is not running.
  • enable => true ensures that the service will autostart after a reboot. The false option ensures that the service is disabled. Lastly, the manual option sets the starting of the service ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required