A collection of task oriented solutions in Puppet


Ensure service is stopped


You want to ensure a service is stopped


class stopped_service {

  service { 'cron':
    ensure => 'stopped',



There are services that should never be running on your hosts and if they are discovered should be stopped. By setting the ensure service property to stopped (or false) puppet will check for the presence of the service on each run and stop it whenever it finds it running.

This property is often used with service disable to ensure a service is both disabled and does not start on boot.

See also