A collection of task oriented solutions in Puppet

 

Ensure service is stopped on boot

Challenge

You want to ensure a service is stopped on boot.

Solution

class disable_service {

  service { 'puppet':
    enable => false,
  }

}
# let's show this snippet in action
$ sudo puppet apply -e "service { 'puppet': enable => false, }"
notice: /Stage[main]//Service[puppet]/enable: enable changed 'true' to 'false'
notice: Finished catalog run in 0.13 seconds

$ chkconfig --list puppet
puppet          0:off 1:off 2:off 3:off 4:off 5:off 6:off

Explanation

Sometimes you want to ensure that a service does not automatically start when the host boots. In puppet you accomplish this by setting the enable property on a service resource.

See also